Tweets by @markusgattol |
IntroductionAt the core of anything told here will be time, the most precious thing we own. For the same reason we do not want to waste time do we not want to waste the time of our users. Second, we care about aesthetics — the overall appearance of a website, even if composed of numerous bits and pieces, must appear to the user like a piece of classical music. It only sounds good because each tone is in harmony with other tones, the sequence they appear in is so that all taken together form a masterpiece
The whole is more than the sum of its parts. The PlayersThree things make for the looks and feels of modern web application:
The GameWhat is The Game? What is the aim of the game? How do players interact, when, and why? MockupStructure
HTML
div/span and class/id
FAQsThis section gathers FAQs about HTML. What is the difference between HTML Block and HTML Inline Elements?In visual browsers, displayable HTML elements can be rendered as
either block or inline. While both are HTML body elements (
Conversely, inline elements are treated as part of the flow of document text i.e. they cannot have margins, width or height set, and do break across lines. Page StructureInlines
HTML 5
Projects / ToolsHAML
AwestructPresentation
Colors
CSS
Cascading / Priority and Order
Pseudo Classes and Elements
Box Model
CSS Layout EnginesConditions and Hacks/Filters
Tips & TricksSprites
CSS FrameworksWhat CSS frameworks give us on top of CSS is, in a nutshell, means for standards-compliant styling our websites across different web browsers as well as ready-made libraries and tools. Those tools/libraries can help us reduce overall development time dramatically by doing a lot of otherwise repetitive and time-consuming work for us. The basic idea behind most CSS frameworks is that the page should be divided into an evenly spaced grid for content to line up with. In print design, this tended to be a vertical and horizontal grid — kind of like graph paper. For the web, it does not really make sense to set up a vertical grid since page heights are not fixed and tend to expand and contract based on the content in them. Because of this, most web design grids are just evenly spaced columns. However, in recent months (starting in early 2010) there has been a major boost in this area and therefore a lot of great ideas already unfolded into software which we can use to have CSS frameworks/tools with almost as much flexible as otherwise only possible when doing all the styling manually from scratch. In fact this (the lack of flexibility) has always been a criticisms towards CSS frameworks. So were bloated source code and the lack of substantial additional features beyond what is already available with plain CSS. It is probably fair to say that with the arrival of Sass and Compass this is true no more, in fact, today one has to have good reasons why to not use a CSS framework but going all manually about styling websites, over and over again, without the ability to reuse or share source code and without the ability to ever reduce TTM (Time to Market). Actually, for the latter it is quite the opposite, as web applications will become bigger, the time needed to do styling will simply go up as well. At some point it will probably become impossible to not use some CSS framework and the ecosystem that goes with it. Below are three of the most used CSS frameworks — two of them (Blueprint and 960) are listed here for reference while the third one (Susy) will be discussed in detail. The rationale is that further down the road we will be using Sass and Compass in connection with Susy — Susy is a semantic CSS grid creator entirely native to Compass, it is lightweight but yet very powerful and compared to most other CSS frameworks out there, very modern (read state of the art technology) and modular in nature. 960
Blueprint
SusySusy is a semantic CSS (Cascading Style Sheets) framework creator entirely native to Compass. Susy is an expert at fluid grids embedded inside an elastic, fluid, or fixed shell that will never activate the side-scroll bar. Susy sets our width on the outer element called FAQs:This section gathers FAQs about Susy. What are Susy's Core Principles?There are two main ideas/principles Susy tries to adhere to — those are mainly about accessibility and usability but also about aesthetics of course:
In order to achieve both goals we need to combine the best of the elastic (em-based) and fluid (%-based) models. The solution is simple: First we build a fluid grid, then place it inside an elastic shell, and apply a maximum width to that shell so that it never exceeds the size of the viewport. It is simple in theory, but daunting in practice, as we constantly have to adjust our math based on the context. Susy harnesses the power of Compass and Sass to do all the math for us so we do not have to bother about such basic but rather we can instead focus on what is really important to us, building beautiful and accessible websites that is. Why would one be using Susy over other CSS frameworks?Finally, why would one be using Susy over other CSS frameworks? Well first of all it is squishy (see core principles and grid types) with a max-width. It also has a great typography system which carries the notion of a vertical rhythm an overall relative measures amongst text size, margins/padding and spacing in general — it just produces great results; Susy/Compass is for the web what LateX/ConTeXt is for print. Again, we consider the ability to handle the elastic/fluid nature of websites that Susy was built to handle its main advantage over other CSS frameworks (e.g. Blueprint). What Susy does is, it gives us a grid that is based on em-units (responsive to font size) as well as percentages (responsive to small window sizes). Susy also allows us to choose the fixed or fluid style as standard, but that is a side benefit of how Susy does things. That is: The Susy grid works in exactly the same way no matter which style we choose — the only change is with the width applied to our grid container. In fact, fluid grids only make sense up to a certain window size — we do not really want our site to fill a 3-inch monitor without changing font size, layout or anything else! Why? Well, our line-lengths would become unreadable and it would just look terrible. For fluid grids that never get too large, it is recommended that we take advantage of Susy's default settings. We simply define our grid in ems, at the largest size we would ever want our site to be. Susy will act fluid up to that point, and suddenly become elastic... Et voilà! We are set for a range screen sizes, from a 30-inch screen all the way down to 3-inch smart-phones. SassSass (Syntactically awesome Style Sheets) is best described as a meta-language/toolset on top of CSS, and is meant to abstract CSS code and create simpler stylesheet files. Even though Sass is a programming language, a DSL (Domain Specific Language) to be more precise, we can only use it to emit CSS.
CSS is the weakest link in the web developers toolbox. The CSS has proven to be an effective way to tell a web browser how to style a web page. But it has failed us as a technology for direct use by professionals who engineer websites. It should now be viewed more as an assembly language that higher-level languages emit, but that we should not be bothered with. Another important point is that Sass is not a lock-in technology. If we ever decide that it is not for us, we keep our generated CSS, throw our Sass away and move along. The really great news about this approach is that we do not have to introduce any new technologies for browsers to build or standards to be adhered to. Instead, we can start using Sass and Compass today and we do not have to fear entering into something which we could not get away from if we want/need to. Sass is also the name for one of two syntax variants possible for Sass the language/toolset. ArchitectureInteraction with the user is done either through
When given an input string, first that string is parsed. When being parsed, the string is transformed into an AST (Abstract
Syntax Tree). AST nodes are subclasses of There are several steps done when compiling the AST to CSS. First it is performed, which means that all dynamic features including any SassScript and control directives are run and resolved. Then is it cssized, which means that any remaining Sass-specific structure is removed i.e. nested rules are resolved, that sort of thing. Finally, it is recursively converted to a CSS string. Language ConstructsVariablesA variable is a simple but important abstraction, by creating a variable with a name that didn’t exist before, you create a new concept. That concept is defined in terms of a simpler concept: a value. FunctionsCSS provides some functions for you to use. For example: rgb(), hsl(), url(). However, there is no mechanism for defining new CSS functions, but this doesn’t mean there couldn’t be. For example, in Sass, with a little ruby programming, you can define your own functions for use within your stylesheets. For example, the compass-colors extension provides a handful of very useful functions for manipulating colors. ExpressionsAn expression creates a new value by combining other values with operators and functions. This is itself an abstraction because it expresses the concept of how to arrive at a new value from other values. While expressions are more typing and reading than just specifying a value, they capture the process of creating the values you used so that later change is simple and others can understand why the value is what it is. MixinsA mixin is the contents of a selector without the selector. We can think of it as a class whose name is only visible to the stylesheet for use within that stylesheet for defining other selectors. Mixins can accept arguments to control their behavior. Mixins can contain other mixins and they can nest selectors too. Mixins are the fundamental unit of abstraction in Sass. They are the building blocks of maintainable stylesheets. Macro ExpansionMacro expansion is the generation of selectors and styles using variables, conditionals, looping, and the like. Macro expansion allows for very high level concepts to be created. For example, a single mixin can generate a whole grid system. FAQsThis section gathers FAQs about Sass. How many different Syntax Variants are there?Two. SCSS (Sassy Cascading Style Sheets) and Sass — the former is pretty close to CSS whereas the latter is whitespace aware (e.g. like Python for example, it is using indentation. It can also parse CSS but then it is not using the Sass semantics when it does so — it just parses it as plain CSS. Go here for more information on the matter. Can I convert a CSS file into Sass or SCSS syntax?Yes, by using the In case we wanted to move an entire project structure of files and
directories living under the CompassCompass is a stylesheet authoring framework, written in 100% Sass. There is nothing that Compass does that we could not do ourselves if we were willing to write all the mixins Compass provides. However, the magical part is that we do not have to. We can start working with the abstractions that have been discussed, tested, and iterated on by a community of designers and front-end engineers. It is a huge time saver because it allows for abstraction. Compass is Project awareAs we know, Compass is made of Sass mixins. One might ask, why not use Sass as is and leave out Compass? The reason is simple, Compass is project aware whereas Sass is not. Sass has its own compiler, but it operates on a single Sass file and generates a single CSS file. Compass on the other hand understands that we have a complete website and provides a compiler for a whole directory tree of Sass files (read project). But distributing a design, is more than just distributing some
stylesheets. There is likely some images. But how can we build
distributable, upgradable stylesheets if those stylesheets need to
refer to an image? Well, we could provide a mixin that takes an
argument, or we could allow a variable to be set that says where it
is. Or, we can use the AbstractionWhat Compass does is it abstracts out things — think of object oriented programming, where we can encapsulate logic/functionality into reusable bits and pieces with a clean and simplified interface wrapped around that complex logic/functionality. Benefits of AbstractionWhether or not we decide to use a framework like Compass, we will benefit from the capability to express abstraction.
Downsides to Abstraction
FAQsThis section gathers FAQs about Compass. Semantics with Sass/Compass?So let us remember real quick — semantics and syntax, every programming language has them. We use syntax (grammatical structure) to express the semantics (meaning). So when we write So, we got three times different syntax (grammatical structure) to express the same semantics (meaning). Now we know the difference between syntax and semantics! Let us make one step from this common discussion into Sass-land. As for the Python and C statements from above, Sass and SCSS can also express the same semantics with different syntax — these statements would then also be semantically the same. LESS and Sass on the on the other hand have different semantics as well as different syntax. We know, CSS 3 and Sass have different syntax. We also know, CSS 3 is the same syntax as SCSS. What Sass brings to the table in addition to plain CSS is better semantics in the form of logic we can use. This type of logic is compile-time logic to be found within the presentation tier. It is not to be confused with the type of logic used inside the logic tier e.g. when we use Django for our web application. The latter would be another tier plus it would be run-time logic. Nicely spoken sir! What was the initial question again? ;-] Well, we wanted to know what it means when somebody says Compass has not just a different syntax but also different (read better) semantics compared to CSS. We discussed the semantics part above. So now, Compass is smarter/better because Sass allows for great semantics. Question is, what can we do with it? Well, we can use it and therefore ease our lives, save time, and build better web applications. Shall I use the Sass or the SCSS Syntax with Compass?Most of us like whitespace aware syntax best, it is more appealing to the human eye and way of working/structuring things. One prominent example for such programming language is Python. As we know, Sass the language/toolset has two syntax variants we can use — Sass (whitespace aware i.e. indented) and SCSS (Sassy Cascading Style Sheets). While the Sass syntax is easier to read/write because of its indented nature, SCSS is more like CSS and therefore used by most people as they start with Compass and/or Sass the toolset. So why did the Compass developers make SCSS the default language in Compass/Sass when in fact the Sass syntax is easier to use and preferred by most in the community, and, last but not least, what does that mean for Sass the syntax? Short VersionSass and SCSS are a 100% interchangeable and Sass is not going to be phased out or something. It is quite the opposite actually... When Sass was originally conceived, it was designed to get rid of the syntactic cruft, and make it quicker to write stylesheets. This has not changed. Why? Read on... Long VersionSince Compass switched from Sass 2 to Sass 3 with version 0.10, the
core of what Sass is then became also a lot more technically robust.
This has allowed us to get rid of a number of syntactic annoyances
like the need to use On top of this core, there are three parsers, one for the indentation/whitespace based syntax called Sass, another one for the CSS superset syntax called SCSS, and one for parsing CSS 3. The way these parsers work is by translating a stylesheet document into a syntax-agnostic representation called an AST (Abstract Syntax Tree), which can then be converted to CSS, Sass, or SCSS. This is also what enables the two, Sass and SCSS, to completely interoperate across imports. Starting with Compass 0.10, SCSS will be the default syntax for new Compass projects, but a simple configuration setting and/or command line switch puts us right back into Sass-land. In short: We do not have to use SCSS to write our stylesheets and there is no intention of deprecating Sass. The decision to change the default syntax of the files in Compass from Sass to SCSS has been made because we want as many people to read and understand it as possible — the majority of designers out there is, as of now (April 2010), using CSS and therefore all the syntactic cruft that goes with it i.e. they are used to semicolons, curly braces, etc. It is not just about syntax though — there was significant community
feedback that suggests that syntax and semantic changes (e.g. the
availability of SassScript) to the language are too much for new users
to absorb. That said, semantics was left untouched, only the default
syntax was switched from Sass to SCSS. However, as indicated already,
we can import any SCSS files into our Sass based projects by simply
removing the So what is the whole point for the switch from Sass to SCSS when in fact Sass is what any serious designer and professional is going to use at some point anyway? One word: Adoption. We want a considerable amount of people join us, come to Sass-land and see/feel the goodness for themselves. In order for that to happen, we can not scare them away with syntactical differences to what they are using right now (read plain CSS and all the syntactical cruft that goes with it). There is strength in numbers. For example: We can share our code with each other, have an easier time hiring, and an easier time convincing our management to let us use this technology. We will also learn and develop best practices by collaborating with each other. So yes, we want to increase adoption because the power of Sass is much less about how it looks like but rather a lot more about how the features it provides changes the way we approach building designs for web application done using Django or any other technology out there. This is why the switch to SCSS as the default syntax in Compass has been made. This is also why it does not matter for all friends of Sass syntax like you and me since, behind the curtain, we are going to use Sass and Sass only anyway. How can I add a left Gutter?As of now (April 2010) most people use Blueprint as their CSS framework below Compass — that might change in favor of Susy though. However, there is one thing that Blueprint does differently to e.g. 960. 960 is what its name implies. It is a 960 pixel wide grid. The grid has 940 pixels of space for content and 10 pixel gutters on the right and left. The 10 pixel gutter on the left is very important. When a browser window is smaller than 960 pixels there is a gutter between the edge of the browser window and the content making it more readable than if the content went right to the windows edge. The Blueprint grid is a 950 pixel wide grid with 24 columns. Each column is 30 pixels wide with a 10 pixel gutter on the right side of each column. What that does is it puts content up to the browser window on the left when the window is smaller than the content area. Some people like that, others do not. From a technical point of view, there might be situations where this can cause problems with regards to readability of contents. This is not a problem however since we can add a gutter to the left side of the content to account for this. Some possible ways we can add a left gutter when using Compass atop Blueprint are:
Can I have a Fluid Grid?Yes, use Susy. How can I debug my obviously wrong Configuration?Like this (only first 10 lines): sa@wks:~$ compass config --debug | head Configuration sources: command_line, stand_alone, implied, defaults ***** preferred_syntax = :scss ***** default: :scss, :scss, :scss, :scss value: -, -, -, - raw: -, -, -, - resolved: :scss, :scss, :scss, :scss ***** extensions_path = "/home/sa/extensions" ***** default: "/home/sa/extensions", "/home/sa/extensions", "/home/sa/extensions", "/home/sa/extensions" value: -, -, -, - sa@wks:~$ Note however that this only works for Compass since neither Sass nor Haml read a configuration file. Install and Configure CompassInstalling and configuring Compass is easy. We can either install the debian package right away 1 wks:/home/sa# aptitude install libcompass-ruby 2 Reading package lists... Done 3 Building dependency tree 4 Reading state information... Done 5 Reading extended state information... Done 6 Initializing package states... Done 7 Reading task descriptions... Done 8 The following NEW packages will be installed: 9 libcompass-ruby libcompass-ruby1.8{a} libffi-ruby1.8{a} libfssm-ruby{a} 10 libfssm-ruby1.8{a} libhaml-ruby{a} libhaml-ruby1.8{a} libinotify-ruby1.8{a} 11 librb-inotify-ruby1.8{a} 12 0 packages upgraded, 9 newly installed, 0 to remove and 1 not upgraded. 13 Need to get 561kB of archives. After unpacking 2,961kB will be used. 14 Do you want to continue? [Y/n/?] y 15 Writing extended state information... Done 16 Get:1 http://ftp2.de.debian.org unstable/main libhaml-ruby1.8 2.2.22-1 [84.7kB] 17 Get:2 http://ftp2.de.debian.org unstable/main libffi-ruby1.8 0.6.2debian-5 [65.5kB] 18 19 20 [skipping a lot of lines...] 21 22 23 wks:/home/sa# exit 24 exit 25 sa@wks:~$ compass --version --quiet 26 0.8.5 or we can grab the development version of Compass using RubyGems as
can be seen in line 48. Of course, for it to work, we need to have
27 sa@wks:~$ su 28 Password: 29 wks:/home/sa# aptitude install rubygems 30 Reading package lists... Done 31 Building dependency tree 32 Reading state information... Done 33 Reading extended state information... Done 34 Initializing package states... Done 35 Reading task descriptions... Done 36 The following NEW packages will be installed: 37 rubygems rubygems1.8{a} 38 0 packages upgraded, 2 newly installed, 0 to remove and 1 not upgraded. 39 Need to get 0B/264kB of archives. After unpacking 967kB will be used. 40 Do you want to continue? [Y/n/?] y 41 Writing extended state information... Done 42 Selecting previously deselected package rubygems1.8. 43 44 45 [skipping a lot of lines...] 46 47 48 wks:/home/sa# gem install --pre compass 49 Successfully installed compass-0.10.0.rc3 50 1 gem installed 51 Installing ri documentation for compass-0.10.0.rc3... 52 Installing RDoc documentation for compass-0.10.0.rc3... 53 wks:/home/sa# gem install --pre compass-susy-plugin 54 Successfully installed compass-susy-plugin-0.7.0.pre7 55 1 gem installed 56 Installing ri documentation for compass-susy-plugin-0.7.0.pre7... 57 Installing RDoc documentation for compass-susy-plugin-0.7.0.pre7... 58 wks:/home/sa# exit 59 exit 60 sa@wks:~$ compass --version --quiet 61 0.8.5 62 sa@wks:~$ which compass 63 /usr/bin/compass 64 sa@wks:~$ gem environment gempath 65 /home/sa/.gem/ruby/1.8:/var/lib/gems/1.8 66 sa@wks:~$ gem environment gemdir 67 /var/lib/gems/1.8 68 sa@wks:~$ $(gem environment gemdir)/bin/compass --version --quiet 69 0.10.0 [6faed20] 70 71 72 [ here we use some editor to edit our ~/.bashrc...] 73 74 75 sa@wks:~$ source .bashrc; alias | grep 'bin/compass' 76 alias compass_dev='$(gem environment gemdir)/bin/compass' 77 sa@wks:~$ compass_dev --version --quiet 78 0.10.0 [6faed20] As we can see from lines 61 and 78, the Debian package and the
development version of Compass are different versions. We can use
both, as the one shipped with Debian is on our search path i.e. There are several ways to make the use of the development version of
Compass as comfortable as possible — I choose to add another alias to
my How to start a Compass Project79 sa@wks:~$ grep -A3 'compass / sass' .bashrc 80 ###_ , compass / sass 81 export COMPASS_PROJECTS=$HOME/0/compass/projects 82 alias compass_dev='$(gem environment gemdir)/bin/compass' 83 alias cdcompass_projects='cd $COMPASS_PROJECTS' 84 sa@wks:~$ source .bashrc 85 sa@wks:~$ mkdir -p $COMPASS_PROJECTS 86 sa@wks:~$ cdcompass_projects 87 sa@wks:~/0/compass/projects$ type la; la 88 la is aliased to `ls -la' 89 total 8 90 drwxr-xr-x 2 sa sa 4096 Apr 11 12:33 . 91 drwxr-xr-x 3 sa sa 4096 Apr 11 12:33 .. Lines 79 to 86 only show what I use to do for all my frameworks like
for example Django and now also for Compass. In my As for all of the frameworks I use, Compass/Sass also have their specific directories as can be seen from lines 87 to 91. Currently it is empty. That is going to change... 92 sa@wks:~/0/compass/projects$ compass_dev -r susy -f susy my_project_$(compass_dev --version --quiet) 93 directory my_project_0.10.0/ 94 directory my_project_0.10.0/src/ 95 directory my_project_0.10.0/stylesheets/ 96 create my_project_0.10.0/config.rb 97 create my_project_0.10.0/src/screen.scss 98 create my_project_0.10.0/src/print.scss 99 create my_project_0.10.0/src/ie.scss 100 create my_project_0.10.0/src/_base.scss 101 create my_project_0.10.0/src/_defaults.scss 102 exists my_project_0.10.0/stylesheets 103 compile my_project_0.10.0/src/screen.scss 104 create my_project_0.10.0/stylesheets/screen.css 105 compile my_project_0.10.0/src/ie.scss 106 create my_project_0.10.0/stylesheets/ie.css 107 compile my_project_0.10.0/src/print.scss 108 create my_project_0.10.0/stylesheets/print.css 109 110 ********************************************************************* 111 Congratulations! Your compass project has been created. 112 113 You may now add and edit sass stylesheets in the src subdirectory of your project. 114 115 Sass files beginning with an underscore are called partials and won't be 116 compiled to CSS, but they can be imported into other sass stylesheets. 117 118 You can configure your project by editing the config.rb configuration file. 119 120 You must compile your sass stylesheets into CSS when they change. 121 This can be done in one of the following ways: 122 To compile on demand: 123 compass compile [path/to/project] 124 To monitor your project for changes and automatically recompile: 125 compass watch [path/to/project] 126 127 More Resources: 128 * Wiki: http://wiki.github.com/chriseppstein/compass 129 * Sass: http://sass-lang.com 130 * Community: http://groups.google.com/group/compass-users/ 131 132 133 To import your new stylesheets add the following lines of HTML (or equivalent) to your webpage: 134 <head> 135 <link href="/stylesheets/screen.scss" media="screen, projection" rel="stylesheet" type="text/css" /> 136 <link href="/stylesheets/print.scss" media="print" rel="stylesheet" type="text/css" /> 137 <link href="/stylesheets/ie.scss" media="screen, projection" rel="stylesheet" type="text/css" /> 138 </head> Lines 92 to 138 is about starting a Compass project using Compass in
its current development version as well as the Susy CSS framework in
its current development version, the ones we installed with lines 48
and 53 respectively. Of course, 139 sa@wks:~/0/compass/projects$ la 140 total 12 141 drwxr-xr-x 3 sa sa 4096 Apr 14 19:24 . 142 drwxr-xr-x 3 sa sa 4096 Apr 11 12:33 .. 143 drwxr-xr-x 5 sa sa 4096 Apr 14 19:24 my_project_0.10.0 144 sa@wks:~/0/compass/projects$ du -sh my_project_0.10.0/ 145 404K my_project_0.10.0/ 146 sa@wks:~/0/compass/projects$ type ta; ta 147 ta is aliased to `tree --charset ascii -a -I \.git*\|*\.\~*\|*\.pyc' 148 . 149 `-- my_project_0.10.0 150 |-- config.rb 151 |-- .sass-cache 152 | |-- 41f90d02892c66026598b74531b77f3b1e2606bc 153 | | |-- _css3.scssc 154 | | |-- _reset.scssc 155 | | `-- _utilities.scssc 156 | |-- 63e43f920f9da19ad363606b847a2e5e6ca7ac2a 157 | | |-- _nowrap.scssc 158 | | `-- _replacement.scssc 159 | |-- 84912882078ea19de6feb59103443596c0c6a009 160 | | |-- _base.scssc 161 | | `-- _defaults.scssc 162 | |-- 8a20f1932f3c762ad4db9f4b5635d41fdcc35f41 163 | | |-- _clearfix.scssc 164 | | |-- _float.scssc 165 | | |-- _hacks.scssc 166 | | |-- _min.scssc 167 | | |-- _reset.scssc 168 | | `-- _tag-cloud.scssc 169 | |-- 8e9739622363678d984c51bbe49dd5e433d3948c 170 | | |-- _background-clip.scssc 171 | | |-- _background-origin.scssc 172 | | |-- _background-size.scssc 173 | | |-- _border-radius.scssc 174 | | |-- _box-shadow.scssc 175 | | |-- _box-sizing.scssc 176 | | |-- _columns.scssc 177 | | |-- _font-face.scssc 178 | | |-- _gradient.scssc 179 | | |-- _inline-block.scssc 180 | | |-- _opacity.scssc 181 | | |-- _text-shadow.scssc 182 | | |-- _transform.scssc 183 | | `-- _transition.scssc 184 | |-- 9078d4cc436542689e1c42ef40c4451d2907c0d5 185 | | |-- _general.scssc 186 | | |-- _links.scssc 187 | | |-- _lists.scssc 188 | | |-- _sprites.scssc 189 | | |-- _tables.scssc 190 | | `-- _text.scssc 191 | |-- ba99b5ac9baf7b5b08cac7fe356b53767cefd7ec 192 | | |-- _alternating-rows-and-columns.scssc 193 | | |-- _borders.scssc 194 | | `-- _scaffolding.scssc 195 | |-- d17e85c048a866eba585e80aed01a502fc9b1846 196 | | |-- _bullets.scssc 197 | | |-- _horizontal-list.scssc 198 | | `-- _inline-list.scssc 199 | |-- d98839f8809f1108727a940a71dc009ad0a5252d 200 | | `-- _sprite-img.scssc 201 | |-- e4e3d1609706bc64588b5eef8b779eff8124f139 202 | | |-- _hover-link.scssc 203 | | |-- _link-colors.scssc 204 | | `-- _unstyled-link.scssc 205 | `-- f74cb806509101f0acc23422bd7a1f59ec304c05 206 | |-- _grid.scssc 207 | |-- _reset.scssc 208 | |-- _susy.scssc 209 | |-- _text.scssc 210 | |-- _utils.scssc 211 | `-- _vertical_rhythm.scssc 212 |-- src 213 | |-- _base.scss 214 | |-- _defaults.scss 215 | |-- ie.scss 216 | |-- print.scss 217 | `-- screen.scss 218 `-- stylesheets 219 |-- ie.css 220 |-- print.css 221 `-- screen.css 222 223 15 directories, 58 files 224 sa@wks:~/0/compass/projects$ The results can be seen from lines 139 to 223. We now have a Compass
project ( Colors
Functions that operate on these values always take the corresponding unit to adjust by. Plugins
fonts BehaviorJavaScriptFAQsHow do I check whether or not JavaScript is enabled?This is a very common use case indeed since if we use JavaScript in
our application, we clearly want our users to have their browser
render/use it. The key here is with the The The noscript element can contain all the elements that we can find inside the body element of a normal HTML page. Please go here for more detailed information on the matter. Visualization
jQueryjQuery, it is a write less, do more JavaScript library. It has many Ajax and JavaScript features that allow you to enhance user experience and semantic coding.
FAQsjQuery in a Nutshell anyone?Sure, this is what jQuery does:
What is a jQuery Object? How is it used?A jQuery object references DOM elements. Trough it we can carry out actions on DOM elements. How does jQuery work? What is Chaining?With jQuery we issue so-called commands/functions which return a jQuery objects. Such object is then used to manipulate the DOM or parts of it. Basically there are two things happening with each jQuery command/function call:
The point here is, each command does both in one go i.e. 1 and 2 from above, each time it is called. Thus the returned jQuery object is a selection of DOM elements with some action already applied to them or ready to be applied.
This is called chaining in jQuery parlance and fluent interfaces in general i.e. we can stack several selector parts (1) as well as several action parts (2) atop each other and then ignite the whole stack — the result is always a jQuery object no matter how tall this stack is when ignited. Command Line MetaphorOne can really think of jQuery as a combination of the command line
sa@wks:~$ echo -e "DOM: I am choosen\nDOM: I am not" DOM: I am choosen DOM: I am not sa@wks:~$ echo -e "DOM: I am choosen\nDOM: I am not" | grep choosen | tr '[a-z]' '[A-Z]' ^^^^^^^^^^^^ 1 ^^^^^^^^^^^^^^^^^^ 2 DOM: I AM CHOOSEN sa@wks:~$ jQuery ExampleA typical jQuery command/function might look like this: $("div.test").add("p.quote").addClass("blue").slideDown("slow"); ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 The selector part (1), taking as input the current DOM, returning a
jQuery object that finds the union of all The Some Functions are prefixed with $. and others with $
jQuery Variables prefixed with Dollar Sign
How can I turn off animation?How can I always use the latest and greatest?Use Equivalence / Shortcuts$()
$(function() { })$(document).ready(function() { // code to execute when the DOM is ready }); is equivalent to $(function() { // code to execute when the DOM is ready }); PluginsExamples
Keyboard NavigationGallery and Sliders
Sliders
Google MapsLayoutTricks and TipsjQuery UI
CSSModernizrAjax
MiscellaneousCDATA
XPath
DOM
Django
Design Examples
Grid AccordionToolsFireSass
ResourcesImages / GraphicsFonts |