Skip to content

Commit c5bed87

Browse files
Deprecate and avoid visually shown mixin
1 parent 0a4fd90 commit c5bed87

2 files changed

Lines changed: 13 additions & 19 deletions

File tree

packages/components/tables/_tables.scss

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -70,31 +70,23 @@
7070

7171
/// Responsive table
7272
///
73-
/// 1. Hiding the thead on mobile
74-
/// 2. Displaying the thead on desktop
75-
/// 3. Removing default screen reader behaviour
76-
/// 4. Assigning role of table-row on desktop to give default screen reader behaviour
77-
/// 5. Using justify content to space out elements in the row on mobile
78-
/// 6. Assigning a minimum width in case of black cell
79-
/// 7. Aligning content to the right on mobile
80-
/// 8. Aligning mobile header to left to split it from the data
81-
/// 9. Hiding mobile specific header from desktop view
82-
/// 10. Adding a display block value due to IE 11 not having full flex support
73+
/// 1. Hide the thead until desktop
74+
/// 2. Removing default screen reader behaviour
75+
/// 3. Assigning role of table-row on desktop to give default screen reader behaviour
76+
/// 4. Using justify content to space out elements in the row on mobile
77+
/// 5. Assigning a minimum width in case of black cell
78+
/// 6. Aligning content to the right on mobile
79+
/// 7. Aligning mobile header to left to split it from the data
80+
/// 8. Hiding mobile specific header from desktop view
81+
/// 9. Adding a display block value due to IE 11 not having full flex support
8382

8483
.nhsuk-table-responsive {
8584
margin-bottom: 0;
8685
width: 100%;
8786

8887
thead {
89-
@include visually-hidden; // [1]
90-
91-
@include mq($from: desktop) {
92-
@include visually-shown($display: table-header-group); // [2]
93-
94-
&::before,
95-
&::after {
96-
content: "";
97-
}
88+
@include mq($until: desktop) {
89+
@include visually-hidden; // [1]
9890
}
9991
}
10092

packages/core/tools/_mixins.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@
105105
///
106106
/// @example scss
107107
/// @include visually-shown($display: table-header-group);
108+
///
109+
/// @deprecated To be removed in v10.0, use @media queries to apply `visually-hidden` instead
108110

109111
@mixin visually-shown($display: null, $important: true) {
110112
position: static if($important, !important, null);

0 commit comments

Comments
 (0)