Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
http://j.mp/drupal-compass
Hello :)
We like Drupal, Sass & Compass. We hope you do too, or will soon.
Note: We co-authored these books, respectively. Were not taking all the credit.
http://hamptoncatlin.com
http://nex-3.com
http://chriseppstein.github.com
(anyways...)
http://infrequently.org/2012/02/misdirection
http://thingsorganizedneatly.tumblr.com/post/9494864300/submission-the-compulsively-tidy-ursus-wehrli
Years ago, we wrote static HTML. Now, we almost never do. Our HTML is virtually always preprocessed, be it by PHP, Python, Ruby, Perl, .NET, Java, or something else. Today, we almost never write and serve straight HTML. Jeff Croft @jcroft
Chief Designerd at nGen Works
http://jeffcroft.com/blog/2012/jan/31/on-css-preprocessors
CSS
Sass
http://sonspring.com/journal/sass-for-designers
Compass
Oversimplification, FTW!
BBEdit
http://barebones.com/bbedit
Chocolat
http://chocolatapp.com
Coda
http://panic.com/coda
E Text Editor
http://e-texteditor.com
Eclipse
http://eclipse.org
Emacs
http://gnu.org/software/emacs
Espresso
http://macrabbit.com/espresso
GEdit
http://projects.gnome.org/gedit
Komodo
http://activestate.com/komodo-ide
Netbeans
http://netbeans.org
PhpStorm
http://jetbrains.com/phpstorm
PyCharm
http://jetbrains.com/pycharm
RubyMine
http://jetbrains.com/ruby
SubEthaEdit
http://codingmonkeys.de/subethaedit
Sublime Text
http://sublimetext.com/dev
TextMate
http://macromates.com
Vim
http://vim.org
Visual Studio
http://microsoft.com/visualstudio
d We recommen
http://sass-lang.com/editors.html
Scout
http://mhs.github.com/scout-app
CodeKit
http://incident57.com/codekit Note: Personally, we prefer to run command-line compass watch
Impression of Sass...
Great for CSS, in Ruby on Rails projects.
Impression of Sass...
Great for CSS, in Ruby on Rails projects. Great for CSS, in Ruby projects.
Impression of Sass...
Great for CSS, in Ruby on Rails projects. Great for CSS, in Ruby projects.
But, wait...
What if I want to use Sass for something that wasnt written in Ruby... impossible?
http://en.wikipedia.org/wiki/The_Incredible_Hulk_(TV_series)
Sass/SCSS module
http://drupal.org/project/sass
Depends on phamlp
http://code.google.com/p/phamlp Last updated in September 2010.
Version and permissions can be an issue Module admin page is hidden (a bug)
Sassy module
http://drupal.org/project/sassy
Several dependencies
http://github.com/richthegeek/phpsass and three other modules.
Sass & SCSS files in .info file styles[] Stores generated files in public files
Note: I dont think this photo is necessarily relevant, but I think we can all agree that raw electricity looks awesome.
https://en.wikipedia.org/wiki/The_Prestige_(film)
Prerequisite: Ruby
For the sake of brevity, we are going to assume in this talk that your environment already has Ruby set up. If not, then follow the instructions here... http://sonspring.com/journal/sass-for-designers
If you just want to flush cache and compile, run compass clean && compass compile
Serving as a aggregate, application.sass is built from _file.sass partials. I bring over what I do like from default Drupal CSS as SCSS files, to import: _search.scss _system.base.scss _system.theme.scss Compass outputs the resulting compiled file as application.css
Sass partials begin with an underscore, arent compiled to *.css files individually.
stylesheets[all][] = assets/css/reset.css stylesheets[all][] = assets/css/override/system.base.css stylesheets[all][] = assets/css/override/system.theme.css stylesheets[all][] = assets/css/override/search.css stylesheets[all][] = assets/css/960_12_col.css stylesheets[all][] = assets/css/text.css stylesheets[all][] = assets/css/formalize.css stylesheets[all][] = assets/css/site.css
This compresses down to a single CSS file, in the Performance cache setting in Drupal.
stylesheets[all][] = assets/css/application.css
ACHIEVEMENT UNLOCKED Only one CSS HTTP request! With (or without) cached CSS compression in Performance.
Even if using compass watch with: output_style = :compressed You should still use Drupals CSS compression under Performance. Why? Well, lets flip to the next slide...
2. <link /> instead of <style>@import</style> (older IE versions are slower at the latter) 3. Drupal replaces url(../images/file.png) with url(/full/path/to/images/file.png) Useful if you have assets on a CDN or subdomain.
Achievement Unlocked!
You have now attained CSS bliss.
Dont forget to rate this as the best talk youve ever heard in your life. Or, maybe we forgot something...
http://autos.yahoo.com/blogs/motoramic/porsche-stuck-wet-cement-proves-karma-exists-210302568.html
While you can track your *.css files via source control, the ones you really care about are your *.sass files, which are the canonical source of truth. Educate peer developers not to edit *.css, but instead tweak *.sass files when making changes.
http://kloucksphoto.blogspot.com/2011/06/guys-and-dolls-witty-wry-wonderful.html
(Nicole helped make Yahoo & Facebook more efficient) We keep thinking we can write better CSS if we just try harder, that the next site will be clean and stay that way. [Her] presentation shows that in fact, messy CSS is the direct result of our worst best-practices. We need to re-examine those assumptions with an eye to practicality and scalability as well as accessibility, standards, and fabulous design. Nicole Sullivan @stubbornella
CSS Ninja & Front-end Performance Engineer
http://stubbornella.org/content/2011/04/28/our-best-practices-are-killing-us
http://twitter.com/NathanSmith
Personal site http://sonspring.com
http://twitter.com/MattFarina
Personal site http://mattfarina.com
Feel free to say hi on Twitter, and/or check out our personal sites for more of our work.
http://j.mp/drupal-compass
Thank You!