Let's talk about our CSS.

Michelle Bu

★TXJS

!important


has a modal.js, modal.template, and a corresponding modal.css
has a few lines in create_new_account_view.css
          
.some_specific_view {

  .some_specific_section {

    background-color: pink;

    ...

  }

  ...
}
          
          

5 minutes in the life of a developer who needs to add some CSS to the existing dashboard.

"I need to add an explanation to this field."

"Let me look for a similar thingy."

"Cool, now inspect element."

"git grep 'div:last-child p'" - nothing

"Alright I'll just take the last one and make it look as close as possible."

"Donezo!"

1. Determination


(MVP)

1 year and 10 engineers later...

2. Development


(remember: poop is append-only.)

1 year and 20 engineers later...

3. Denial


6 months and 40 engineers later...

4. Despair

No tests

"It's almost impossible to test CSS." *

* sorta

No conventions

.potato { span { ... } }

div.potato > span

div.potato span

.potato-inner

.potato_inner

#potato_inner

No CSS reuse

transfers_list_view.css
Yup

sublist_subscriptions_list_item.css

Nope

Why does it matter?

No CSS reuse

Boot

Documentation

No conventions

.namespace-
ComponentName
(-descendant)
(--descriptor)

.bs-

BigNumber

-delimiter

--comma



rework

rework

rework

Tools make conventions easier.

rework-stripe-conformance

Tools make conventions easier.

rework-namespace

.namespace-

ComponentName

-descendant

--descriptor

Tools make developers happier.

rework-inherit

Checkbox
Radio button

Tools make developers happier.

Tools make developers happier.

kfcss

Abstraction!


5 678 ,99
€5.678,99
{{bs-big-number number=5678.99 country="DE"}}

Abstraction!

No tests


rework-pseudo-classes

grunt-huxley

.modal-dialog-view div.modal div.modal-content-form div:last-child p

.bs-Fieldset-explanation


Thanks! :)

@michelle on Github

@hazelcough on Twitter


Resources: