Skip to content

Commit 3e829e7

Browse files
author
Joao Fernandes
committed
Improve accessibility of notes
1 parent 6823f36 commit 3e829e7

File tree

2 files changed

+39
-15
lines changed

2 files changed

+39
-15
lines changed

_scss/_notes.scss

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,45 @@ blockquote {
1212

1313
blockquote > p:first-child {
1414
margin-top: 0;
15+
font-weight: 700;
16+
color: $info-color;
1517
}
1618

17-
blockquote > p > strong {
18-
color: $info-color;
19+
blockquote > p:first-child::before {
20+
content: 'Note: ';
1921
}
2022

2123
blockquote.warning {
2224
border-left-color: $warning-color;
2325
}
2426

25-
blockquote.warning > p > strong {
27+
blockquote.warning > p:first-child {
2628
color: $warning-color;
2729
}
2830

31+
blockquote.warning > p:first-child::before {
32+
content: 'Be careful: ';
33+
}
34+
2935
blockquote.danger {
3036
border-left-color: $danger-color;
3137
}
3238

33-
blockquote.danger > p > strong {
39+
blockquote.danger > p:first-child {
3440
color: $danger-color;
3541
}
42+
43+
blockquote.danger > p:first-child::before {
44+
content: 'Warning: '
45+
}
46+
47+
/* Maintain backwards compatibility with old
48+
* note style
49+
*/
50+
blockquote > p:only-child {
51+
font-weight: inherit;
52+
color: inherit;
53+
}
54+
blockquote > p:only-child::before {
55+
content: none;
56+
}

test.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,13 @@ might be interesting. You can use them with Markdown or HTML images.
142142

143143
Some tables in markdown and html.
144144

145-
| Permission level | Access |
146-
| ---------------- | ------------- |
147-
| **Bold** or _italic_ within a table cell. Next cell is empty on purpose. | |
148-
| | Previous cell is empty. A `--flag` in mono text. |
149-
| Read | Pull |
150-
| Read/Write | Pull, push |
151-
| Admin | All of the above, plus update description, create and delete |
145+
| Permission level | Access |
146+
|:-------------------------------------------------------------------------|:-------------------------------------------------------------|
147+
| **Bold** or _italic_ within a table cell. Next cell is empty on purpose. | |
148+
| | Previous cell is empty. A `--flag` in mono text. |
149+
| Read | Pull |
150+
| Read/Write | Pull, push |
151+
| Admin | All of the above, plus update description, create and delete |
152152

153153
The alignment of the cells in the source doesn't really matter. The ending pipe
154154
character is optional (unless the last cell is supposed to be empty). The header
@@ -353,17 +353,20 @@ Bootstrap JS are loaded.
353353

354354
> **Note**: This is a note using the old note style
355355

356-
> **This is a note using the new style**
356+
> **Note**: This is a note using
357+
> the old style and has multiple lines, but a single paragraph
358+
359+
> Pssst, wanna know something?
357360
>
358-
> And you include a small description here telling users to be on the lookout
361+
> You include a small description here telling users to be on the lookout
359362

360-
> **Be careful out there**
363+
> It's not safe out there, take this Moby with you
361364
>
362365
> Add the `warning` class to your blockquotes if you want to tell users
363366
> to be careful about something.
364367
{: .warning}
365368
366-
> **Ouch, don't do that!**
369+
> Ouch, don't do that!
367370
>
368371
> Use the `danger` class to let people know this is dangerous or they
369372
> should pay close attention to this part of the road.

0 commit comments

Comments
 (0)