Skip to content
This repository has been archived by the owner. It is now read-only.

Allow hyphenated BEM in CSS #79

Merged
merged 1 commit into from Jul 26, 2017
Merged

Allow hyphenated BEM in CSS #79

merged 1 commit into from Jul 26, 2017

Conversation

@fofr
Copy link
Contributor

@fofr fofr commented Jul 26, 2017

The GOV.UK Frontend alpha uses a BEM convention:
https://github.com/alphagov/govuk-frontend/blob/master/docs/coding-standards/css.md

This convention encourages isolation within components.

GOV.UK Publishing Frontend (www.gov.uk) are writing components that conform to this convention. Components should be easily movable/promotable to GOV.UK Frontend when appropriate.

Selector Allowed
.block
.b-block
.b-block-name
.b-block--modifier
.block_modifier
.block--modifier-value
.b-block-name--modifier-name-here-value-name-here
.b-block__element
.block--modifier-value__element
.block__element--modifier-value
.block__element--modifier
.a_block__element--modifier
.block__an_element--modifier
.block__element--a_modifier

This is the same as @alecgibson’s PR which had a lot of debate: #65

In February we decided not to do this here, most of those concerns have since been addressed:
#65 (comment)

* An extension of our original rules, hyphenated classes are still ok
* Allows underscores in BEM classes only
* Specifics of what is/is not allowed here:
  https://github.com/brigade/scss-lint/blob/d8645c43c85bae837e283b498c39af63575c8a82/spec/scss_lint/linter/selector_format_spec.rb#L539-L630
@nickcolley nickcolley merged commit 4a8dd6c into master Jul 26, 2017
1 check passed
1 check passed
continuous-integration/jenkins/branch This commit looks good
Details
@nickcolley nickcolley deleted the hyphenated-bem branch Jul 26, 2017
fofr added a commit that referenced this pull request Jul 27, 2017
Relax class naming rules for Sass to allow hyphenated BEM classes (#79)
@fofr fofr mentioned this pull request Jul 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.