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>
<title>Fruit stand</title>
<%= stylesheet_link_tag quot;applicationquot; %>
<%= stylesheet_link_tag quot;applesquot...
<head>
<title>Fruit stand</title>
<%= stylesheet_link_tag quot;applicationquot; %>
<%= stylesheet_link_tag quot;applesquot...
<head>
<title>Fruit stand</title>
<%= stylesheet_link_tag quot;applicationquot; %>
<%= stylesheet_link_tag quot;applesquot...
<head>
<title>Fruit stand</title>
<%= stylesheet_link_tag quot;applicationquot; %>
<%= stylesheet_link_tag quot;applesquot...
<head>
<title>My website</title>
<%= stylesheet_link_tag quot;applicationquot; %>
<% [quot;applesquot;, quot;bananasquot;,...
Let’s DRY it up!
<head>
<title>My website</title>
<%= stylesheet_link_tag quot;applicationquot; %>
<% [quot;applesquot;, quot;bananasquot;,...
<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
Styler
Upcoming SlideShare
Loading in …5
×

Styler

1,541 views
1,503 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,541
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
12
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Styler

  1. 1. Patrick Crowley the.railsi.st
  2. 2. Styler <%= stylesheets %>
  3. 3. DRY up stylesheet configuration
  4. 4. <head> <title>Fruit stand</title> <%= stylesheet_link_tag quot;applicationquot; %> </head>
  5. 5. <head> <title>Fruit stand</title> <%= stylesheet_link_tag quot;applicationquot; %> <%= stylesheet_link_tag quot;applesquot; %> </head>
  6. 6. <head> <title>Fruit stand</title> <%= stylesheet_link_tag quot;applicationquot; %> <%= stylesheet_link_tag quot;applesquot; %> <%= stylesheet_link_tag quot;bananasquot; %> </head>
  7. 7. <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>
  8. 8. <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>
  9. 9. <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>
  10. 10. <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>
  11. 11. Let’s DRY it up!
  12. 12. <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>
  13. 13. <head> <title>My website</title> <%= stylesheets %> </head>
  14. 14. Use Rails naming conventions for css
  15. 15. application.css controller.css controller_action.css
  16. 16. ie7.css ie6.css (conditionally)
  17. 17. Need more?
  18. 18. <head> <title>My website</title> <%= stylesheets :include => quot;resetquot; %> </head>
  19. 19. <head> <title>My website</title> <%= stylesheets :include => [quot;resetquot;, quot;fontsquot;] %> </head>
  20. 20. Generator
  21. 21. script/generate stylesheets
  22. 22. Download now at http://the.railsi.st
  23. 23. The End

×