Skip to content

Commit a22b12c

Browse files
committed
Add common code block style
1 parent fafdd1c commit a22b12c

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

digital_land_frontend/src/scss/core/_typography.scss

+24
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,27 @@
66
.dl-small-text {
77
@include govuk-font($size: 16);
88
}
9+
10+
// styles for code blocks
11+
12+
.dl-code-block {
13+
background: #f4f4f4;
14+
color: #333;
15+
page-break-inside: avoid;
16+
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
17+
line-height: 1.3;
18+
margin:0;
19+
max-width: 100%;
20+
overflow-y: scroll;
21+
padding: govuk-spacing(3);
22+
display: block;
23+
word-wrap: break-word;
24+
max-height: calc(1em * 12);
25+
font-size: 1rem;
26+
}
27+
28+
.dl-code-block--inline {
29+
display: inline-block;
30+
padding: govuk-spacing(1) govuk-spacing(2);
31+
vertical-align: middle;
32+
}

package/digital-land-frontend/core/_typography.scss

+24
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,27 @@
66
.dl-small-text {
77
@include govuk-font($size: 16);
88
}
9+
10+
// styles for code blocks
11+
12+
.dl-code-block {
13+
background: #f4f4f4;
14+
color: #333;
15+
page-break-inside: avoid;
16+
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
17+
line-height: 1.3;
18+
margin:0;
19+
max-width: 100%;
20+
overflow-y: scroll;
21+
padding: govuk-spacing(3);
22+
display: block;
23+
word-wrap: break-word;
24+
max-height: calc(1em * 12);
25+
font-size: 1rem;
26+
}
27+
28+
.dl-code-block--inline {
29+
display: inline-block;
30+
padding: govuk-spacing(1) govuk-spacing(2);
31+
vertical-align: middle;
32+
}

0 commit comments

Comments
 (0)