Styler
Upcoming SlideShare
Loading in...5
×
 

Styler

on

  • 2,217 views

 

Statistics

Views

Total Views
2,217
Views on SlideShare
2,215
Embed Views
2

Actions

Likes
0
Downloads
11
Comments
0

1 Embed 2

http://www.slideshare.net 2

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Styler Styler Presentation Transcript

  • Patrick Crowley the.railsi.st
  • Styler <%= stylesheets %>
  • DRY up stylesheet configuration
  • <head> <title>Fruit stand</title> <%= stylesheet_link_tag quot;applicationquot; %> </head>
  • <head> <title>Fruit stand</title> <%= stylesheet_link_tag quot;applicationquot; %> <%= stylesheet_link_tag quot;applesquot; %> </head>
  • <head> <title>Fruit stand</title> <%= stylesheet_link_tag quot;applicationquot; %> <%= stylesheet_link_tag quot;applesquot; %> <%= stylesheet_link_tag quot;bananasquot; %> </head>
  • <head> <title>Fruit stand</title> <%= stylesheet_link_tag quot;applicationquot; %> <%= stylesheet_link_tag quot;applesquot; %> <%= stylesheet_link_tag quot;bananasquot; %> <%= stylesheet_link_tag quot;cherriesquot; %> </head>
  • <head> <title>Fruit stand</title> <%= stylesheet_link_tag quot;applicationquot; %> <%= stylesheet_link_tag quot;applesquot; %> <%= stylesheet_link_tag quot;bananasquot; %> <%= stylesheet_link_tag quot;cherriesquot; %> <!--[if IE 7]> <%= stylesheet_link_tag quot;ie7quot; %> <![endif]--> </head>
  • <head> <title>Fruit stand</title> <%= stylesheet_link_tag quot;applicationquot; %> <%= stylesheet_link_tag quot;applesquot; %> <%= stylesheet_link_tag quot;bananasquot; %> <%= stylesheet_link_tag quot;cherriesquot; %> <!--[if IE 7]> <%= stylesheet_link_tag quot;ie7quot; %> <![endif]--> <!--[if IE 6]> <%= stylesheet_link_tag quot;ie6quot; %> <![endif]--> </head>
  • <head> <title>My website</title> <%= stylesheet_link_tag quot;applicationquot; %> <% [quot;applesquot;, quot;bananasquot;, quot;cherriesquot;].each do |s| if controller.controller_name == s stylesheet_link_tag s end %> <!--[if IE 7]> <%= stylesheet_link_tag quot;ie7quot; %> <![endif]--> <!--[if IE 6]> <%= stylesheet_link_tag quot;ie6quot; %> <![endif]--> </head>
  • Let’s DRY it up!
  • <head> <title>My website</title> <%= stylesheet_link_tag quot;applicationquot; %> <% [quot;applesquot;, quot;bananasquot;, quot;cherriesquot;].each do |s| if controller.controller_name == s stylesheet_link_tag s end %> <!--[if IE 7]> <%= stylesheet_link_tag quot;ie7quot; %> <![endif]--> <!--[if IE 6]> <%= stylesheet_link_tag quot;ie6quot; %> <![endif]--> </head>
  • <head> <title>My website</title> <%= stylesheets %> </head>
  • Use Rails naming conventions for css
  • application.css controller.css controller_action.css
  • ie7.css ie6.css (conditionally)
  • Need more?
  • <head> <title>My website</title> <%= stylesheets :include => quot;resetquot; %> </head>
  • <head> <title>My website</title> <%= stylesheets :include => [quot;resetquot;, quot;fontsquot;] %> </head>
  • Generator
  • script/generate stylesheets
  • Download now at http://the.railsi.st
  • The End