Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: enable PostCSS syntax for Stylelint + fixes #1135

Merged
merged 3 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions docs/assets/stylesheets/components/_accordions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,21 @@
#ACCORDIONS
========================================================================== */

// stylelint-disable declaration-no-important

.govuk-accordion__section-button:hover {
// stylelint-disable-next-line declaration-no-important
background: #ebebeb !important;
}

.govuk-accordion__show-all:hover {
// stylelint-disable-next-line declaration-no-important
background: #ebebeb !important;
// stylelint-disable-next-line declaration-no-important
box-shadow:
0 -2px #ebebeb,
0 4px #ebebeb !important;
}
Comment on lines 11 to 16
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prettier multi-line formatting made // stylelint-disable-next-line target the wrong line


.govuk-accordion__show-all:focus {
// stylelint-disable-next-line declaration-no-important
background: $govuk-focus-colour !important;
// stylelint-disable-next-line declaration-no-important
box-shadow:
0 -2px $govuk-focus-colour,
0 4px $govuk-text-colour !important;
Expand Down
14 changes: 7 additions & 7 deletions docs/production/installing-with-npm.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,21 +110,21 @@ To use different asset paths, set `$govuk-assets-path`, `$govuk-images-path` and

Example 1:

```SCSS
```scss
// Include images from /application/assets/images and fonts from /application/assets/fonts
$moj-assets-path: /application/assets;
$moj-assets-path: "/application/assets/";

@import @ministryofjustice/frontend/moj/all;
@import "@ministryofjustice/frontend/moj/all";
```

Example 2:

```SCSS
```scss
// Include images from /images/@ministryofjustice/frontend and fonts from /fonts
$moj-images-path: /images/@ministryofjustice/frontend/moj/;
$moj-fonts-path: /fonts/;
$moj-images-path: "/images/@ministryofjustice/frontend/moj/";
$moj-fonts-path: "/fonts/";

@import @ministryofjustice/frontend/moj/all;
@import "@ministryofjustice/frontend/moj/all";
```

## Importing JavaScript
Expand Down
87 changes: 87 additions & 0 deletions package-lock.json

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

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@
"mock-match-media": "^0.4.3",
"npm-run-all2": "^6.0.0",
"postcss": "^8.4.31",
"postcss-markdown": "^1.3.0",
"postcss-scss": "^4.0.9",
"semantic-release": "^23.0.0",
"sinon": "^19.0.2",
"stylelint": "^16.13.2",
Expand Down
12 changes: 8 additions & 4 deletions stylelint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@ module.exports = {
'CHANGELOG.md'
],
overrides: [
// {
// customSyntax: 'postcss-scss',
// files: ['**/*.scss']
// }
{
customSyntax: 'postcss-markdown',
files: ['**/*.md']
},
{
customSyntax: 'postcss-scss',
files: ['**/*.scss']
}
],
plugins: ['stylelint-order'],
rules: {
Expand Down