Skip to content

Commit 72a6a50

Browse files
committed
😈 Modify to suit Kickoff's conventions
Still needs a bit of work but this is close...
1 parent 4198f0d commit 72a6a50

File tree

1 file changed

+32
-34
lines changed

1 file changed

+32
-34
lines changed

README.md

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ goals.
2626
- [Preprocessors: additional format considerations](#preprocessors-additional-format-considerations)
2727
- [Linting](#linting)
2828
- [Naming conventions](#naming-conventions)
29-
- [BEM](#bem)
29+
- [Kickoff](#kickoff)
3030
- [Namespacing](#namespacing)
3131
- [CSS frameworks](#css-frameworks)
3232
- [State hooks](#state-hooks)
@@ -127,7 +127,7 @@ For reference here is an anatomy of a rule set:
127127

128128
### Formatting rules
129129

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.
131131
- Use one discrete selector per line in multi-selector rule sets.
132132

133133
**Good**
@@ -318,15 +318,15 @@ For reference here is an anatomy of a rule set:
318318
```scss
319319
@include box-shadow( 0 2px 2px rgba( 0, 0, 0, .2 ) );
320320
```
321-
- When a decimal mark is needed always include the zero.
321+
- When a decimal mark is needed there is no need to include the zero.
322322

323323
**Good**
324324
```scss
325-
0.25rem
325+
.25rem
326326
```
327327
**Bad**
328328
```scss
329-
.25rem
329+
0.25rem
330330
```
331331
- Don't write trailing zeros for numeric values with a decimal point.
332332

@@ -433,25 +433,25 @@ Always ensure classes are sensibly named; keep them as short as possible but as
433433

434434
[Further reading](http://cssguidelin.es/#naming-conventions).
435435

436-
### BEM
436+
### Kickoff
437437

438-
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`.
439439

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.
441441

442442
The naming convention follows this pattern:
443443

444444
```
445445
.block{}
446-
.block__element{}
446+
.block-element{}
447447
.block--modifier{}
448448
```
449449

450450
- `.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.
452452
- `.block--modifier` represents a different state or version of `.block`.
453453

454-
[Further reading](http://csswizardry.com/2013/01/mindbemding-getting-your-head-round-bem-syntax/).
454+
[Further reading](http://trykickoff.com/learn/css.html#namingscheme).
455455

456456
### Namespacing
457457

@@ -487,7 +487,7 @@ This means that we can attach both JS and CSS to classes in our markup but there
487487

488488
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.
489489

490-
**JS hooks do not use BEM.**
490+
**JS hooks do not use the Kickoff naming convention.**
491491

492492
#### Test and Tracking hooks
493493

@@ -499,7 +499,7 @@ Tracking hooks are used for tracking elements for analytics.
499499

500500
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]`.
501501

502-
**Test and Tracking hooks hooks do not use BEM.**
502+
**Test and Tracking hooks hooks do not use the Kickoff naming convention.**
503503

504504
##### Order of the above hooks
505505

@@ -508,7 +508,8 @@ The order of the above hooks, within the `class` attribute, should be:
508508
1. Style hooks:
509509
1. Component hook (no namespace)
510510
2. Layout hook (`.l-`)
511-
3. Utility hook (`u-`)
511+
3. Utility hook (`.u-`)
512+
3. Grid hook (`.g-`)
512513
2. JS hooks (`.js-`)
513514
3. Test hooks (`.test-`)
514515
4. Tracking hooks (`.track-`)
@@ -562,21 +563,16 @@ If you use Sublime Text editor then install [this package](https://sublime.wbond
562563
Every `.scss` file should always have a main title comment at the very top of the file and formatted like this:
563564

564565
```
565-
/* ============================================================================
566-
@COMPONENTS -> PAGINATON
567-
========================================================================= */
568-
```
569-
570-
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:
571-
572-
```
573-
/* ============================================================================
574-
@CORE -> MIXINS -> CONVERT PX TO EM/REM
575-
========================================================================= */
566+
/**
567+
* Title
568+
* Description
569+
* - Table of contents item 1
570+
* - Table of contents item 2
571+
* - Table of contents item 3
572+
573+
*/
576574
```
577575

578-
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-
580576
**2 blank lines should always come after a main title comment.**
581577

582578
### Intro block
@@ -690,12 +686,10 @@ Each major chunk of CSS in a file should begin with a sub title comment e.g.
690686

691687
```
692688
/**
693-
* Grid container.
689+
* Grid container
694690
*/
695691
```
696692

697-
A full stop (period) should end the sub title comment.
698-
699693
**2 blank lines should come before and 1 blank line should come after these sub title comments.**
700694

701695
### Preprocessor comments
@@ -767,9 +761,9 @@ This is the format to use:
767761
*/
768762
```
769763

770-
### BEM modifier comments
764+
### Modifier comments
771765

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.
773767

774768
```
775769
/**
@@ -779,7 +773,9 @@ Whenever you're using BEM and you declare a modifier (see [Naming conventions ->
779773
*/
780774
781775
.u-table--striped {
782-
tbody tr:nth-of-type(odd) td {background-color: $u-table-striped-background-cell-colour;}
776+
tbody tr:nth-of-type(odd) td {
777+
background-color: $u-table-striped-background-cell-colour;
778+
}
783779
}
784780
```
785781

@@ -823,7 +819,9 @@ Whenever you write some styles for non-JavaScript users always include a comment
823819

824820
```
825821
// Non-JS users
826-
.no-js .selector {position: static;}
822+
.no-js .selector {
823+
position: static;
824+
}
827825
```
828826

829827
### `!important` comments

0 commit comments

Comments
 (0)