smacss your up minamarkham i need two demo sites
play

smacss your up @minamarkham I need two demo sites And I need them - PowerPoint PPT Presentation

smacss your up @minamarkham I need two demo sites And I need them in two days CSS is easy. hard CSS is easy. CSS is bullshit. Modular CSS Focusing on creating healthy front-end modules instead of complete pages can help


  1. smacss your up

  2. @minamarkham

  3. “I need two demo sites” “And I need them in two days”

  4. CSS is easy.

  5. hard CSS is easy.

  6. CSS is bullshit.

  7. Modular CSS

  8. Focusing on creating healthy “ front-end modules instead of complete pages can help break complex page layouts into reusable solutions .” - Dave Rupert

  9. small pieces independent portable

  10. Navigation, Tabs, Tables, Accordions, Lists, Dropdowns Pagination, Buttons, Labels, Inputs, Breadcrumbs, etc.

  11. “Tiny Bootstraps”

  12. Module, Pattern, Component, etc.

  13. MVCSS, BEM, OOCSS, Suit, intuit.css

  14. SMACSS

  15. S calable & M odular A rchitecture for CSS

  16. Framework

  17. categorization naming conventions depth of applicability

  18. Categorization

  19. base layout modules states themes

  20. Base CSS resets, default styles (ex. html, body, h1, ul, etc)

  21. Layout grid, major components ex. header, sidebar, nav

  22. header content footer

  23. header sidebar main content

  24. Modules content patterns (ex. search-box, navigation, content-box)

  25. navigation hero promo promo promo promo footer-text link-list

  26. States module in various states

  27. Themes module in various contexts

  28. jessicahische.is

  29. Naming Conventions

  30. Base h1, h2, p, a, etc.

  31. Layout .layout-*, .l-*

  32. Module .<name>

  33. Module .button

  34. Sub-module .<name>-<state>

  35. Sub-module .button-secondary

  36. State .is-*

  37. Theme .theme-*

  38. Theme .theme-*

  39. Depth of Applicability

  40. header#top-menu > nav > ul > li a + div > ul > li > ul li:hover > a {…}

  41. 10 generations!

  42. , , , Specificity = 0,1,1,11 http://specificity.keegan.st/

  43. header#top-menu > nav > ul > li a + div > ul > li > ul li:hover > a {…}

  44. header#top-menu > nav > ul > li a + div > ul > li > ul li:hover > a {…}

  45. .nav-subitem

  46. , , , Specificity = 0,0,1,0 http://specificity.keegan.st/

  47. .nav-subitem > a

  48. , , , Specificity = 0,0,1,1 http://specificity.keegan.st/

  49. child selectors class selectors naming conventions

  50. Recap

  51. categorize css rules meaningful names shallow selectors

  52. add some

  53. not SASS

  54. Namespacing

  55. the almighty ampersand

  56. .btn { &:hover {…} }

  57. .btn:hover {…}

  58. .btn { form & {…} }

  59. form .btn {…}

  60. &- or &_

  61. .btn { .btn &-secondary {…} &_secondary {…} }

  62. .btn-secondary {…} .btn_secondary {…}

  63. nesting

  64. inception rule

  65. < 3 levels deep

  66. .btn { .btn &-secondary { secondary &-icon {…} } }

  67. .btn-secondary {…} .btn-secondary-icon {…}

  68. .btn {…} .btn-large {…} � <div class=“btn btn-large”>

  69. @ extend all the things!

  70. .btn {…} .btn-large {@extend .btn;} � <div class=“btn-large”>

  71. %btn {…} .btn-large {@extend %btn;} � <div class=“btn-large”>

  72. don’t @extend between modules

  73. File Structure

  74. @import

  75. 01. ¡Utilities ¡ utilities/_index.scss Variables, mixins, functions, etc. @import ¡'global'; ¡ @import ¡'functions'; ¡ Basically anything that doesn’t @import ¡'mixins'; ¡ output CSS by itself. @import ¡'helpers';

  76. 01. ¡Utilities ¡ 02. ¡Libraries ¡ utilities/_lib.scss Third-party libraries such @import ¡"lib/susy"; ¡ @import ¡"lib/font-­‑awesome"; ¡ as Susy, Font Awesome, @import ¡"lib/pesticide"; Pesticide, and other plugins.

  77. 01. ¡Utilities ¡ 02. ¡Libraries ¡ 03. ¡Base ¡ base/_index.scss @import ¡‘normalize'; ¡ CSS resets, Normalize, @import ¡'base'; element styles

  78. 01. ¡Utilities ¡ 02. ¡Libraries ¡ 03. ¡Base ¡ 04. ¡Layout ¡ layout/_index.scss Grid styles, major layout @import ¡'global'; ¡ @import ¡'functions'; ¡ components (e.g. header, footer, @import ¡'mixins'; ¡ sidebar, etc) @import ¡'helpers';

  79. 01. ¡Utilities ¡ 02. ¡Libraries ¡ 03. ¡Base ¡ 04. ¡Layout ¡ 05. ¡Modules ¡ modules/_index.scss Individual modules, such as @import ¡'btn'; ¡ @import ¡'table'; ¡ buttons, navigation, menus, etc. @import ¡'nav';

  80. 01. ¡Utilities ¡ 02. ¡Libraries ¡ 03. ¡Base ¡ 04. ¡Layout ¡ 05. ¡Modules ¡ 06. ¡States ¡ states/_index.scss @import ¡'states'; ¡ Describe states of being, ex: @import ¡'touch'; active, collapsed or hidden

  81. 01. ¡Utilities ¡ 02. ¡Libraries ¡ 03. ¡Base ¡ 04. ¡Layout ¡ 05. ¡Modules ¡ 06. ¡States ¡ 07. ¡@font-­‑face Web fonts imports & declarations utilities/_fonts.scss

  82. 01. ¡Utilities ¡ 02. ¡Libraries ¡ 03. ¡Base ¡ 04. ¡Layout ¡ 05. ¡Modules ¡ 06. ¡States ¡ 07. ¡@font-­‑face ¡ 08. ¡Print ¡ Print styles states/_print.scss

  83. !important

  84. shame.css

  85. _shame.scss

  86. 01. ¡Utilities ¡ 02. ¡Libraries ¡ 03. ¡Base ¡ 04. ¡Layout ¡ 05. ¡Modules ¡ 06. ¡States ¡ 07. ¡@font-­‑face ¡ 08. ¡Print ¡ 09. ¡Shame because hacks happen _shame.scss

  87. small and readable

  88. mina.so/sassyStarter

  89. Theming

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend