Skip to content

Commit

Permalink
fix: add force-colors to backgroundStyles and update button styles to…
Browse files Browse the repository at this point in the history
… fix the card and button components (microsoft#17231)

* add force-colors backgroundStyles and set a few HC colors on button styles

* Change files

* adjust forece colors import order

* update to use attribute instead of class. fixed href color issues
  • Loading branch information
khamudom authored and joshualamusga1 committed Mar 25, 2021
1 parent c70970a commit 268440b
Show file tree
Hide file tree
Showing 3 changed files with 184 additions and 153 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "add force-colors backgroundStyles and set a few HC colors on button styles",
"packageName": "@fluentui/web-components",
"email": "khamu@microsoft.com",
"dependentChangeType": "patch"
}
16 changes: 14 additions & 2 deletions packages/web-components/src/design-system-provider/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { attr, css, nullableNumberConverter } from '@microsoft/fast-element';
import { Direction } from '@microsoft/fast-web-utilities';
import { Direction, SystemColors } from '@microsoft/fast-web-utilities';
import {
CSSCustomPropertyBehavior,
designSystemProperty,
DesignSystemProvider,
designSystemProvider,
forcedColorsStylesheetBehavior,
DesignSystemProviderTemplate as template,
} from '@microsoft/fast-foundation';
import { parseColorHexRGB } from '@microsoft/fast-colors';
Expand All @@ -23,7 +24,18 @@ const backgroundStyles = css`
background-color: var(--background-color);
color: ${color.var};
}
`.withBehaviors(color);
`.withBehaviors(
color,
forcedColorsStylesheetBehavior(
css`
:host {
background-color: ${SystemColors.ButtonFace};
box-shadow: 0 0 0 1px ${SystemColors.CanvasText};
color: ${SystemColors.ButtonText};
}
`,
),
);

/**
* The Fluent DesignSystemProvider Element. Implements {@link @microsoft/fast-foundation#DesignSystemProvider},
Expand Down
Loading

0 comments on commit 268440b

Please sign in to comment.