Skip to content

Commit 8c94f6a

Browse files
Merge pull request #1589 from nhsuk/stylelint-order
Configure Stylelint with GOV.UK Frontend property order
2 parents 883702d + b1c29eb commit 8c94f6a

56 files changed

Lines changed: 950 additions & 563 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.stylelintrc.js

Lines changed: 0 additions & 114 deletions
This file was deleted.

docs/contributing/linting.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ We use the following rules when linting files:
1313
Bad:
1414

1515
```scss
16-
.selector {border: 0; padding: 0;}
16+
.selector { padding: 0; border: 0;}
1717
```
1818

1919
Good:
2020

2121
```scss
2222
.selector {
23-
border: 0;
2423
padding: 0;
24+
border: 0;
2525
}
2626
```
2727

packages/nhsuk-frontend/src/nhsuk/components/action-link/_index.scss

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323

2424
.nhsuk-action-link {
2525
display: inline-block; // [1]
26-
padding-left: nhsuk-px-to-rem($_small-icon-size + $_small-icon-spacing); // [2]
2726
position: relative; // [3]
27+
padding-left: nhsuk-px-to-rem($_small-icon-size + $_small-icon-spacing); // [2]
2828
text-decoration: none; // [4]
2929

3030
&:not(:focus):hover {
@@ -42,20 +42,20 @@
4242
@include nhsuk-responsive-margin(6, "bottom");
4343

4444
@include nhsuk-media-query($from: tablet) {
45-
line-height: nhsuk-line-height($_large-icon-size, $font-size: 22);
4645
padding-left: nhsuk-px-to-rem($_large-icon-size + $_large-icon-spacing); // [2]
46+
line-height: nhsuk-line-height($_large-icon-size, $font-size: 22);
4747
}
4848

4949
.nhsuk-icon {
50+
position: absolute;
51+
left: nhsuk-px-to-rem(-$_small-icon-spacing);
5052
// stylelint-disable-next-line declaration-no-important
5153
fill: nhsuk-colour("green") !important;
52-
left: nhsuk-px-to-rem(-$_small-icon-spacing);
53-
position: absolute;
5454

5555
@include nhsuk-media-query($from: tablet) {
56-
height: nhsuk-px-to-rem($_large-icon-size);
57-
width: nhsuk-px-to-rem($_large-icon-size);
5856
left: nhsuk-px-to-rem(-$_large-icon-spacing);
57+
width: nhsuk-px-to-rem($_large-icon-size);
58+
height: nhsuk-px-to-rem($_large-icon-size);
5959
}
6060
}
6161

packages/nhsuk-frontend/src/nhsuk/components/back-link/_index.scss

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,18 @@
1414
$_font-size: 16;
1515

1616
.nhsuk-back-link {
17-
background: none;
18-
border: 0;
19-
cursor: pointer;
2017
display: inline-block;
18+
19+
position: relative;
20+
2121
padding: 0;
2222
padding-left: nhsuk-em($_font-size, $nhsuk-base-font-size);
23-
position: relative;
23+
24+
border: 0;
25+
26+
background: none;
27+
28+
cursor: pointer;
2429

2530
@include nhsuk-font($_font-size);
2631
@include nhsuk-link-style-default;
@@ -29,12 +34,14 @@
2934
@include nhsuk-print-hide; // [2]
3035

3136
&::before {
32-
bottom: 0;
3337
content: "";
34-
left: 0;
35-
margin: auto;
38+
3639
position: absolute;
3740
top: 0;
41+
bottom: 0;
42+
left: 0;
43+
44+
margin: auto;
3845

3946
@include nhsuk-shape-chevron(left, $colour: currentcolor, $font-size: 19);
4047
}

packages/nhsuk-frontend/src/nhsuk/components/breadcrumb/_index.scss

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
}
3535

3636
.nhsuk-breadcrumb__list {
37-
list-style: none;
3837
margin: 0;
3938
padding: 0;
39+
list-style: none;
4040

4141
@include nhsuk-clearfix;
4242
@include nhsuk-font($_font-size);
@@ -47,19 +47,21 @@
4747
}
4848

4949
.nhsuk-breadcrumb__list-item {
50-
float: left;
50+
position: relative;
5151
margin-bottom: 0;
5252
margin-left: nhsuk-em(nhsuk-spacing(3), $_font-size); // [3]
5353
padding-left: nhsuk-em(nhsuk-spacing(3), $_font-size) + $_chevron-size; // [3]
54-
position: relative;
54+
float: left;
5555

5656
&::before {
57-
bottom: 0;
5857
content: "";
59-
left: 0;
60-
margin: auto;
58+
6159
position: absolute;
6260
top: 0;
61+
bottom: 0;
62+
left: 0;
63+
64+
margin: auto;
6365

6466
@include nhsuk-shape-chevron(right, $_chevron-colour);
6567
}

0 commit comments

Comments
 (0)