Skip to content

Commit b30ade6

Browse files
Aitema-gmbhFedo Hagge-Kubatrusackasclaude
authored
fix(a11y): WCAG 1.4.4 — replace hardcoded px with theme tokens for text resize (#39235)
Co-authored-by: Fedo Hagge-Kubat <office@aitema.org> Co-authored-by: Evan Rusackas <evan@preset.io> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 01925f6 commit b30ade6

10 files changed

Lines changed: 21 additions & 20 deletions

File tree

‎superset-frontend/src/SqlLab/components/RunQueryActionButton/index.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ const isMainButtonGesture = (event: SyntheticEvent<HTMLSpanElement>) =>
9292

9393
const StyledButton = styled.span`
9494
button {
95-
line-height: 13px;
95+
line-height: 1.2;
9696
min-width: auto !important;
9797
padding: 0 ${({ theme }) => theme.sizeUnit * 3}px 0
9898
${({ theme }) => theme.sizeUnit * 2}px;

‎superset-frontend/src/SqlLab/components/ScheduleQueryButton/index.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ export const StyledButtonComponent = styled(Button)`
111111
background: none;
112112
text-transform: none;
113113
padding: 0px;
114-
font-size: 14px;
115114
font-weight: ${theme.fontWeightNormal};
116115
margin-left: 0;
117116
&:disabled {

‎superset-frontend/src/SqlLab/components/TabbedSqlEditors/index.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const StyledEditableTabs = styled(EditableTabs)`
8383
`;
8484

8585
const StyledTab = styled.span`
86-
line-height: 24px;
86+
line-height: 1.5;
8787
`;
8888

8989
const TabTitle = styled.span`

‎superset-frontend/src/dashboard/components/CustomizationsBadge/index.tsx‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ const StyledTag = styled(Tag)`
9393
vertical-align: middle;
9494
color: ${theme.colorTextSecondary};
9595
margin-right: ${theme.sizeUnit * 0.5}px;
96-
font-size: 12px;
96+
font-size: 1em;
9797
&:hover {
9898
color: ${theme.colorText};
9999
}
@@ -118,7 +118,7 @@ const StyledBadge = styled(Badge)`
118118
height: ${theme.sizeUnit * 3}px;
119119
line-height: 1.2;
120120
font-weight: ${theme.fontWeightStrong};
121-
font-size: ${theme.fontSizeSM - 2}px;
121+
font-size: ${(theme.fontSizeSM - 2) / theme.fontSize}em;
122122
box-shadow: none;
123123
}
124124
`}
@@ -130,14 +130,13 @@ const TooltipContent = styled.div`
130130
max-width: 300px;
131131
overflow-x: hidden;
132132
color: ${theme.colorText};
133-
font-size: ${theme.fontSizeSM}px;
133+
font-size: ${theme.fontSizeSM / theme.fontSize}em;
134134
`}
135135
`;
136136

137137
const SectionName = styled.span`
138138
${({ theme }) => `
139139
font-weight: ${theme.fontWeightStrong};
140-
font-size: ${theme.fontSizeSM}px;
141140
`}
142141
`;
143142

@@ -152,7 +151,6 @@ const GroupByInfo = styled.div`
152151

153152
const GroupByItem = styled.div`
154153
${({ theme }) => `
155-
font-size: ${theme.fontSizeSM}px;
156154
margin-bottom: ${theme.sizeUnit}px;
157155
158156
&:last-child {

‎superset-frontend/src/dashboard/components/SliceHeader/index.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ const ChartHeaderStyles = styled.div`
119119
& > .header-controls {
120120
display: flex;
121121
align-items: center;
122-
height: 24px;
122+
min-height: 24px;
123123
}
124124
125125
.dropdown.btn-group {

‎superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ const RefreshTooltip = styled.div`
8080
height: auto;
8181
margin: ${theme.sizeUnit}px 0;
8282
color: ${theme.colorTextLabel};
83-
line-height: 21px;
83+
line-height: 1.5;
8484
display: flex;
8585
flex-direction: column;
8686
align-items: flex-start;
@@ -805,7 +805,8 @@ const SliceHeaderControls = (
805805
<>
806806
{isFullSize && (
807807
<Icons.FullscreenExitOutlined
808-
style={{ fontSize: 22 }}
808+
style={{ fontSize: `${theme.fontSizeXL / theme.fontSize}em` }}
809+
aria-label={t('Exit fullscreen')}
809810
onClick={() => {
810811
if (document.fullscreenElement) {
811812
exitChartFullscreen();

‎superset-frontend/src/explore/components/controls/DateFilterControl/DateFilterLabel.tsx‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,16 @@ const ContentStyleWrapper = styled.div`
8181
}
8282
8383
.control-label {
84-
font-size: ${theme.fontSizeSM}px;
85-
line-height: 16px;
84+
font-size: ${theme.fontSizeSM / theme.fontSize}em;
85+
line-height: 1.2;
8686
margin: 8px 0;
8787
}
8888
8989
.section-title {
9090
font-style: normal;
9191
font-weight: ${theme.fontWeightStrong};
92-
font-size: 15px;
93-
line-height: 24px;
92+
font-size: 1em;
93+
line-height: 1.5;
9494
margin-bottom: 8px;
9595
}
9696

‎superset-frontend/src/features/home/Menu.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const StyledBrandText = styled.div`
8585
justify-content: center;
8686
8787
span {
88-
max-width: ${theme.sizeUnit * 58}px;
88+
max-width: 100%;
8989
white-space: nowrap;
9090
overflow: hidden;
9191
text-overflow: ellipsis;
@@ -196,8 +196,8 @@ const StyledRow = styled(Row)`
196196
const StyledCol = styled(Col)`
197197
${({ theme }) => css`
198198
display: flex;
199-
gap: ${theme.sizeUnit * 4}px;
200199
flex-wrap: wrap;
200+
gap: ${theme.sizeUnit * 4}px;
201201
`}
202202
`;
203203

‎superset-frontend/src/features/home/SubMenu.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const StyledHeader = styled.div<{ backgroundColor?: string }>`
6060
text-align: left;
6161
font-size: 18px;
6262
display: inline-block;
63-
line-height: ${({ theme }) => theme.sizeUnit * 9}px;
63+
line-height: 1.5;
6464
}
6565
.nav-right {
6666
display: flex;
@@ -97,7 +97,7 @@ const StyledHeader = styled.div<{ backgroundColor?: string }>`
9797
9898
.menu > .ant-menu {
9999
padding-left: ${({ theme }) => theme.sizeUnit * 5}px;
100-
line-height: ${({ theme }) => theme.sizeUnit * 5}px;
100+
line-height: 1.5;
101101
102102
.ant-menu-item {
103103
border-radius: ${({ theme }) => theme.borderRadius}px;

‎superset-frontend/src/visualizations/TimeTable/components/SparklineCell/SparklineCell.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,10 @@ const SparklineCell = ({
231231
<div
232232
css={() => ({
233233
color: theme.colorTextSecondary,
234-
fontSize: '12px',
234+
// Use em so secondary timestamp scales with the
235+
// surrounding cell font-size when users adjust
236+
// browser default text size (WCAG 1.4.4).
237+
fontSize: '0.85em',
235238
})}
236239
>
237240
{formatTime(

0 commit comments

Comments
 (0)