You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+32-34Lines changed: 32 additions & 34 deletions
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ goals.
26
26
-[Preprocessors: additional format considerations](#preprocessors-additional-format-considerations)
27
27
-[Linting](#linting)
28
28
-[Naming conventions](#naming-conventions)
29
-
-[BEM](#bem)
29
+
-[Kickoff](#kickoff)
30
30
-[Namespacing](#namespacing)
31
31
-[CSS frameworks](#css-frameworks)
32
32
-[State hooks](#state-hooks)
@@ -127,7 +127,7 @@ For reference here is an anatomy of a rule set:
127
127
128
128
### Formatting rules
129
129
130
-
- Class names to use BEM notation, see [Naming Conventions -> BEM](#bem), where BEM isn't used then hyphen delimited class names are to be used.
130
+
- Class names to use the Kickoff notation, see [Naming Conventions -> Kickoff](#kickoff), where Kickoff isn't used then hyphen delimited class names are to be used.
131
131
- Use one discrete selector per line in multi-selector rule sets.
132
132
133
133
**Good**
@@ -318,15 +318,15 @@ For reference here is an anatomy of a rule set:
We use the BEM (Block, Element, Modifier) naming convention. When BEM is not used e.g. [JavaScript hooks](#javascript-hooks) then we use hyphen delimited classes e.g. `.foo-bar`, not `.foo_bar` or `.fooBar`.
438
+
We use the Kickoff naming convention. When this is not used e.g. [JavaScript hooks](#javascript-hooks) then we use hyphen delimited classes e.g. `.foo-bar`, not `.foo_bar` or `.fooBar`.
439
439
440
-
BEM is a methodology for naming and classifying CSS selectors in a way to make them a lot more strict, transparent and informative.
440
+
Kickoff's naming convention is similar to BEM, it is a methodology for naming and classifying CSS selectors in a way to make them a lot more strict, transparent and informative.
441
441
442
442
The naming convention follows this pattern:
443
443
444
444
```
445
445
.block{}
446
-
.block__element{}
446
+
.block-element{}
447
447
.block--modifier{}
448
448
```
449
449
450
450
-`.block` represents the higher level of an abstraction or component.
451
-
-`.block__element` represents a descendent of `.block` that helps form `.block` as a whole.
451
+
-`.block-element` represents a descendent of `.block` that helps form `.block` as a whole.
452
452
-`.block--modifier` represents a different state or version of `.block`.
@@ -487,7 +487,7 @@ This means that we can attach both JS and CSS to classes in our markup but there
487
487
488
488
A common practice is to use data-* attributes as JS hooks, but this is incorrect. data-* attributes, as per the [spec](http://www.w3.org/TR/2011/WD-html5-20110525/elements.html#embedding-custom-non-visible-data-with-the-data-attributes), are used to store custom data private to the page or application (emphasis mine). data-* attributes are designed to store data, not be bound to.
489
489
490
-
**JS hooks do not use BEM.**
490
+
**JS hooks do not use the Kickoff naming convention.**
491
491
492
492
#### Test and Tracking hooks
493
493
@@ -499,7 +499,7 @@ Tracking hooks are used for tracking elements for analytics.
499
499
500
500
They're simply classes namespaced like so: `.test-` (test) / `.track` (tracking) and follow the same naming convention as JS Hooks e.g. `.test-[component]-[UI-it's-affecting]` / `.track-[component]-[UI-it's-affecting]`.
501
501
502
-
**Test and Tracking hooks hooks do not use BEM.**
502
+
**Test and Tracking hooks hooks do not use the Kickoff naming convention.**
503
503
504
504
##### Order of the above hooks
505
505
@@ -508,7 +508,8 @@ The order of the above hooks, within the `class` attribute, should be:
508
508
1. Style hooks:
509
509
1. Component hook (no namespace)
510
510
2. Layout hook (`.l-`)
511
-
3. Utility hook (`u-`)
511
+
3. Utility hook (`.u-`)
512
+
3. Grid hook (`.g-`)
512
513
2. JS hooks (`.js-`)
513
514
3. Test hooks (`.test-`)
514
515
4. Tracking hooks (`.track-`)
@@ -562,21 +563,16 @@ If you use Sublime Text editor then install [this package](https://sublime.wbond
562
563
Every `.scss` file should always have a main title comment at the very top of the file and formatted like this:
The first part, prefixed with an `@` symbol, represents the location of the file within the CSS architecture (see [Architecture Overview](#architecture-overview)). The second part represents what the `.scss` file is actually styling which in most cases will be a component. It's similar to a breadcrumb pattern, so for a more deeply nested file we'll have this:
Each main title is prefixed with an `@` symbol to allow us to perform more targeted searches (e.g. `grep`, etc.) and is always in uppercase.
579
-
580
576
**2 blank lines should always come after a main title comment.**
581
577
582
578
### Intro block
@@ -690,12 +686,10 @@ Each major chunk of CSS in a file should begin with a sub title comment e.g.
690
686
691
687
```
692
688
/**
693
-
* Grid container.
689
+
* Grid container
694
690
*/
695
691
```
696
692
697
-
A full stop (period) should end the sub title comment.
698
-
699
693
**2 blank lines should come before and 1 blank line should come after these sub title comments.**
700
694
701
695
### Preprocessor comments
@@ -767,9 +761,9 @@ This is the format to use:
767
761
*/
768
762
```
769
763
770
-
### BEM modifier comments
764
+
### Modifier comments
771
765
772
-
Whenever you're using BEM and you declare a modifier (see [Naming conventions -> BEM](#bem)) you need to include a comment and if required provide a brief explanation as to what it's doing, e.g.
766
+
Whenever you're using BEM and you declare a modifier (see [Naming conventions -> Kickoff](#kickoff)) you need to include a comment and if required provide a brief explanation as to what it's doing, e.g.
773
767
774
768
```
775
769
/**
@@ -779,7 +773,9 @@ Whenever you're using BEM and you declare a modifier (see [Naming conventions ->
0 commit comments