Skip to content

Commit

Permalink
Merge pull request #1 from alphagov/pseudo-element-colon
Browse files Browse the repository at this point in the history
Require single colons for pseudo-element rules
  • Loading branch information
kevindew authored Jul 20, 2020
2 parents c01efe7 + 0702461 commit 18a34ba
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ common at GDS) however the CSS rules can be used alone.
To add this to your project, install stylelint and this module:

```bash
npm install --save-dev stylelint styelint-config-gds@0.1.0-pre.1
npm install --save-dev stylelint styelint-config-gds@0.1.0-pre.2
```

You then need to [configure](https://stylelint.io/user-guide/configure)
Expand Down
6 changes: 6 additions & 0 deletions css.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ module.exports = {
ignore: ['attribute']
}
],
// Require single colons for defining pseudo-elements
// IE8 and below do not support the modern double colon approach. Although
// few projects support IE8, we'd prefer to not exclude compatibility for
// purely syntactic reasons.
// https://stylelint.io/user-guide/rules/selector-pseudo-element-colon-notation
'selector-pseudo-element-colon-notation': 'single',
// Disallow redundant properties in rules (for example: margin: 1px 1px 1px;)
// https://stylelint.io/user-guide/rules/shorthand-property-no-redundant-values
// Originates from: https://github.com/alphagov/govuk-frontend/blob/e248b4027102b2684f592a0501630075bdfa1fab/config/.sass-lint.yml#L436
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
{
"name": "stylelint-config-gds",
"version": "0.1.0-pre.1",
"version": "0.1.0-pre.2",
"description": "A work-in-progress Stylelint configuration for the UK Government Digital Service.",
"main": "scss.js",
"scripts": {
"pretest": "npm run lint",
"test": "jest",
"lint": "standard"
},
"files": ["scss.js", "css.js"],
"files": [
"scss.js",
"css.js"
],
"repository": {
"type": "git",
"url": "https://github.com/alphagov/stylelint-config-gds.git"
Expand Down

0 comments on commit 18a34ba

Please sign in to comment.