Skip to content

Commit 723e8d4

Browse files
authored
Improve accessibility of default link focus styles in Firefox (tailwindlabs#5082)
1 parent e233288 commit 723e8d4

File tree

5 files changed

+60
-0
lines changed

5 files changed

+60
-0
lines changed

src/plugins/css/preflight.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,18 @@ button,
140140
cursor: pointer;
141141
}
142142

143+
/**
144+
* Override legacy focus reset from Normalize with modern Firefox focus styles.
145+
*
146+
* This is actually an improvement over the new defaults in Firefox in our testing,
147+
* as it triggers the better focus styles even for links, which still use a dotted
148+
* outline in Firefox by default.
149+
*/
150+
151+
:-moz-focusring {
152+
outline: auto;
153+
}
154+
143155
table {
144156
border-collapse: collapse;
145157
}

tests/fixtures/tailwind-output-flagged.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,18 @@ button,
440440
cursor: pointer;
441441
}
442442

443+
/**
444+
* Override legacy focus reset from Normalize with modern Firefox focus styles.
445+
*
446+
* This is actually an improvement over the new defaults in Firefox in our testing,
447+
* as it triggers the better focus styles even for links, which still use a dotted
448+
* outline in Firefox by default.
449+
*/
450+
451+
:-moz-focusring {
452+
outline: auto;
453+
}
454+
443455
table {
444456
border-collapse: collapse;
445457
}

tests/fixtures/tailwind-output-important.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,18 @@ button,
440440
cursor: pointer;
441441
}
442442

443+
/**
444+
* Override legacy focus reset from Normalize with modern Firefox focus styles.
445+
*
446+
* This is actually an improvement over the new defaults in Firefox in our testing,
447+
* as it triggers the better focus styles even for links, which still use a dotted
448+
* outline in Firefox by default.
449+
*/
450+
451+
:-moz-focusring {
452+
outline: auto;
453+
}
454+
443455
table {
444456
border-collapse: collapse;
445457
}

tests/fixtures/tailwind-output-no-color-opacity.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,18 @@ button,
440440
cursor: pointer;
441441
}
442442

443+
/**
444+
* Override legacy focus reset from Normalize with modern Firefox focus styles.
445+
*
446+
* This is actually an improvement over the new defaults in Firefox in our testing,
447+
* as it triggers the better focus styles even for links, which still use a dotted
448+
* outline in Firefox by default.
449+
*/
450+
451+
:-moz-focusring {
452+
outline: auto;
453+
}
454+
443455
table {
444456
border-collapse: collapse;
445457
}

tests/fixtures/tailwind-output.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,18 @@ button,
440440
cursor: pointer;
441441
}
442442

443+
/**
444+
* Override legacy focus reset from Normalize with modern Firefox focus styles.
445+
*
446+
* This is actually an improvement over the new defaults in Firefox in our testing,
447+
* as it triggers the better focus styles even for links, which still use a dotted
448+
* outline in Firefox by default.
449+
*/
450+
451+
:-moz-focusring {
452+
outline: auto;
453+
}
454+
443455
table {
444456
border-collapse: collapse;
445457
}

0 commit comments

Comments
 (0)