Skip to content

Commit befc650

Browse files
authored
fix(web-components): update dropdown to fix forced-colors mode states (#35340)
1 parent d9c729c commit befc650

File tree

4 files changed

+25
-3
lines changed

4 files changed

+25
-3
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "prerelease",
3+
"comment": "fix: update dropdown forced-colors mode states",
4+
"packageName": "@fluentui/web-components",
5+
"email": "rupertdavid@microsoft.com",
6+
"dependentChangeType": "patch"
7+
}

packages/web-components/src/dropdown/dropdown.styles.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export const styles = css`
7373
appearance: none;
7474
background-color: ${colorNeutralBackground1};
7575
border-radius: ${borderRadiusMedium};
76-
border: none;
76+
border: ${strokeWidthThin} solid ${colorTransparentStroke};
7777
box-shadow: inset 0 0 0 ${strokeWidthThin} var(--control-border-color);
7878
box-sizing: border-box;
7979
color: inherit;
@@ -251,4 +251,12 @@ export const styles = css`
251251
--margin-offset: calc(${lineHeightBase400} + (${spacingVerticalS} * 2) + ${strokeWidthThin});
252252
}
253253
}
254+
255+
@media (forced-colors: active) {
256+
:host(:disabled) .control {
257+
border-color: GrayText;
258+
}
259+
:host(:disabled) :where(slot[name='indicator'] > *, ::slotted([slot='indicator'])) {
260+
color: GrayText;
261+
}
254262
`;

packages/web-components/src/listbox/listbox.styles.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ import { flipBlockState } from '../styles/states/index.js';
33
import {
44
borderRadiusMedium,
55
colorNeutralBackground1,
6+
colorTransparentStroke,
67
shadow16,
78
spacingHorizontalXS,
89
spacingHorizontalXXS,
10+
strokeWidthThin,
911
} from '../theme/design-tokens.js';
1012
import { display } from '../utils/display.js';
1113

@@ -20,7 +22,7 @@ export const styles = css`
2022
:host {
2123
background-color: ${colorNeutralBackground1};
2224
border-radius: ${borderRadiusMedium};
23-
border: none;
25+
border: ${strokeWidthThin} solid ${colorTransparentStroke};
2426
box-shadow: ${shadow16};
2527
box-sizing: border-box;
2628
flex-direction: column;

packages/web-components/src/option/option.styles.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ export const styles = css`
4141
align-items: center;
4242
background-color: ${colorNeutralBackground1};
4343
border-radius: ${borderRadiusMedium};
44-
border: ${strokeWidthThick} solid ${colorTransparentStroke};
4544
box-sizing: border-box;
4645
color: ${colorNeutralForeground2};
4746
column-gap: ${spacingHorizontalXS};
@@ -148,4 +147,10 @@ export const styles = css`
148147
grid-area: description;
149148
${typographyCaption1Styles}
150149
}
150+
151+
@media (forced-colors: active) {
152+
:host(:disabled) {
153+
color: GrayText;
154+
}
155+
}
151156
`;

0 commit comments

Comments
 (0)