Skip to content

Commit

Permalink
Add languages to all Markdown code blocks
Browse files Browse the repository at this point in the history
Only unreleased CHANGELOG lines have been included
  • Loading branch information
colinrotherham committed Jun 7, 2023
1 parent 014d4e9 commit 4f6a747
Show file tree
Hide file tree
Showing 11 changed files with 88 additions and 76 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const Button = require('govuk-frontend/dist/govuk/components/button/button')

For example using `import`:

```js
```mjs
import Button from 'govuk-frontend/dist/govuk-esm/components/button/button.mjs'
```

Expand Down
80 changes: 40 additions & 40 deletions docs/contributing/coding-standards/css.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ given class name. It also discourages excessive nesting.

Bad:

```
```scss
.govuk-breadcrumb {
...
&__item {
Expand All @@ -67,7 +67,7 @@ Bad:

Good:

```
```scss
.govuk-breadcrumb {
...
}
Expand Down Expand Up @@ -132,13 +132,13 @@ We use the following rules when linting files:

Bad:

```
```scss
.selector {padding: 0; border: 0;}
```

Good:

```
```scss
.selector {
padding: 0;
border: 0;
Expand All @@ -149,15 +149,15 @@ Good:

Bad:

```
```scss
.selector {
color: #005ea5;
}
```

Good:

```
```scss
.selector {
color: $govuk-blue;
}
Expand All @@ -167,29 +167,29 @@ Good:

Bad:

```
```scss
$white: #FFF;
```

Good:

```
```scss
$white: #ffffff;
```

### Avoid using ID selectors

Bad:

```
```scss
#content {
...
}
```

Good:

```
```scss
.govuk-wrapper {
...
}
Expand All @@ -201,15 +201,15 @@ This is to ensure compatibility with Internet Explorer 8, which doesn't support

Bad:

```
```scss
.selector::before {
content: "foo";
}
```

Good:

```
```scss
.selector:before {
content: "foo";
}
Expand All @@ -219,7 +219,7 @@ Good:

Bad:

```
```scss
p {
margin: 0;
em {
Expand All @@ -233,7 +233,7 @@ a {

Good:

```
```scss
p {
margin: 0;

Expand All @@ -251,7 +251,7 @@ a {

Bad:

```
```scss
.govuk-breadcrumb {
...
&__item {
Expand All @@ -262,7 +262,7 @@ Bad:

Good:

```
```scss
.govuk-breadcrumb {
...
}
Expand All @@ -276,35 +276,35 @@ Good:

Bad:

```
```scss
@extend %contain-floats;
```

Good:

```
```scss
@include clearfix;
```

### Allow max 3-rule property shorthand if possible

Bad:

```
```scss
margin: 1px 2px 3px 2px;
```

Good:

```
```scss
margin: 1px 2px 3px;
```

### Strings should always use double quotes

Bad:

```
```scss
@import 'foo';

$govuk-font-family-gds-transport: 'GDS Transport', arial, sans-serif;
Expand All @@ -316,7 +316,7 @@ $govuk-font-family-gds-transport: 'GDS Transport', arial, sans-serif;

Good:

```
```scss
@import "foo";

$govuk-font-family-gds-transport: "GDS Transport", arial, sans-serif;
Expand All @@ -332,14 +332,14 @@ $govuk-font-family-gds-transport: "GDS Transport", arial, sans-serif;

Bad:

```
```scss
@import "_foo.scss";
@import "_bar/foo.scss";
```

Good:

```
```scss
@import "foo";
@import "bar/foo";
```
Expand All @@ -348,15 +348,15 @@ Good:

Bad:

```
```scss
.foo {
content:"bar";
}
```

Good:

```
```scss
.foo {
content: "bar";
}
Expand All @@ -366,15 +366,15 @@ Good:

Bad:

```
```scss
@if ($foo == $bar) {
$baz: 1;
}
```

Good:

```
```scss
@if $foo == $bar {
$baz: 1;
}
Expand All @@ -384,15 +384,15 @@ Good:

Bad:

```
```scss
@if $foo == null {
$baz: 1;
}
```

Good:

```
```scss
@if not $foo {
$baz: 1;
}
Expand All @@ -402,7 +402,7 @@ Good:

Bad:

```
```scss
.selector {
margin: 5px+15px;
}
Expand All @@ -428,7 +428,7 @@ $bar: 2-1;

Good:

```
```scss
.selector {
margin: 5px + 15px;
}
Expand Down Expand Up @@ -456,15 +456,15 @@ $bar: 2 - 1;

Bad:

```
```scss
@mixin FONT_STACK() {
font-family: $govuk-font-stack;
}
```

Good:

```
```scss
@mixin font-stack() {
font-family: $govuk-font-stack;
}
Expand All @@ -474,15 +474,15 @@ Good:

Bad:

```
```scss
.selector {
margin: 0px;
}
```

Good:

```
```scss
.selector {
margin: 0;
}
Expand All @@ -492,7 +492,7 @@ Good:

Bad:

```
```scss
.selector {
margin: 0
}
Expand All @@ -502,7 +502,7 @@ $my-example-var: value

Good:

```
```scss
.selector {
margin: 0;
}
Expand All @@ -514,15 +514,15 @@ $my-example-var: value;

Bad:

```
```scss
.selector {
font-size: 0.50em;
}
```

Good:

```
```scss
.selector {
font-size: .5em;
}
Expand Down
Loading

0 comments on commit 4f6a747

Please sign in to comment.