lines added count the number of words git log --author=$NAME -c \ -- app/assets/stylesheets/ \ | grep -E '^\+ ' \ | wc -w Let's inspect how one of my coworkers wrote CSS code.
been in use in programming. class Button { ... } class SaveButton extends Button { ... } class DeleteButton extends Button { ... } "Object-oriented Programming"
UIIUIUIN UIIUNIUN UIUNUN INU UINUIU UIIUIUIN UIIUNIUN UIUNUN INU UINUIU .photo-card { &__image { ... } &__heading { ... } &__description { ... } &__actions { ... } } BEM with Sass made CSS very fun to write. BEM wi t h SAS S
style. 2003 ✓ Create a component library. 2011 ✓ Everything is a component. 2012 ✓ CSS conventions are extremely useful. 2013 ✗ Writing CSS and markup properly is hard. 2013
UIIUIUIN UIIUNIUN UIUNUN INU UINUIU UIIUIUIN UIIUNIUN UIUNUN INU UINUIU <div> {{photo-image}} {{photo-heading}} {{photo-description}} {{photo-actions}} </div> So did Ember.js. EM BE R .j s
style. 2003 ✓ Create a component library. 2011 ✓ Everything is a still component. 2012, 2014 ✓ CSS conventions are extremely useful. 2013 ✗ Writing CSS and markup properly is hard. 2014
2 ACTION 1 Subtitle here Title goes here ACTION 2 ACTION 1 ACTION Single-line snackbar 60 ACTION Single-line snackbar 60 Campbell Groceries: almond milk coconut water cucumber Campbell Groceries: almond milk coconut water cucumber Trevor Hansen Verdana Courier Calibri Arial Verdana Courier Calibri Arial Verdana Courier Calibri Arial 1 4:15 One Day 1 4:15 One Day 1 4:15 One Day DISABLED DISABLED Subtitle here Title goes here ACTION 2 ACTION 1 Subtitle here Title goes here ACTION 2 ACTION 1 ACTION Single-line snackbar 60 Campbell Groceries: almond milk coconut water cucumber Campbell Groceries: almond milk coconut water cucumber Trevor Hansen Verdana Courier Calibri Arial Verdana Courier Calibri Arial Verdana Courier Calibri Arial 1 4:15 One Day 1 4:15 One Day 1 4:15 One Day DISABLED DISABLED Subtitle here Title goes here ACTION 2 ACTION 1 Single-line snackba 60 Groceries: almond m coconut w
style. 2003 ✓ Create a component library. 2011 ✓ Everything is a component. 2012 ✓ CSS conventions are extremely useful. 2013 ✗ Writing CSS and markup properly is hard.
</div> The secret is in the direct child selector (>). UIIUIUIN UIIUNIUN UIUNUN INU UINUIU UIIUIUIN UIIUNIUN UIUNUN INU UINUIU UIIUIUIN UIIUNIUN UIUNUN INU UINUIU .photo-card { > .image { ... } > .actions > .button { ... } } RS CSS w it h SAS S
... } > .text > .heading { ... } } callout-box.scss • • • This makes it easy to include them all. One component per CSS file. Rule No. 5— @import 'components/*'; application.scss • • •
<h3>Warning!</h3> <p>Don't try this at home.</p> </div> <link rel="import" href="warning.html"> People started separating content from style. warning.html index.html