-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add neutral-contrast-fill color recipe to the design system (#1…
…6824) * add neutral-contrast-fill recipe * Change files * fixed import in behavior * update api-report
- Loading branch information
Showing
7 changed files
with
256 additions
and
1 deletion.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
...ntui-web-components-2021-02-04-11-30-33-users-khamu-add-neutral-contrast-fill-recipe.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"type": "minor", | ||
"comment": "add neutral-contrast-fill recipe", | ||
"packageName": "@fluentui/web-components", | ||
"email": "khamu@microsoft.com", | ||
"dependentChangeType": "patch", | ||
"date": "2021-02-04T19:30:33.719Z" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
packages/web-components/src/color/neutral-contrast-fill.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { | ||
neutralContrastFillActiveDelta, | ||
neutralContrastFillFocusDelta, | ||
neutralContrastFillHoverDelta, | ||
neutralPalette, | ||
} from '../fluent-design-system'; | ||
import { | ||
colorRecipeFactory, | ||
SwatchFamilyResolver, | ||
swatchFamilyToSwatchRecipeFactory, | ||
SwatchFamilyType, | ||
SwatchRecipe, | ||
} from './common'; | ||
import { accessibleAlgorithm } from './accessible-recipe'; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
export const neutralContrastFill: SwatchFamilyResolver = colorRecipeFactory( | ||
accessibleAlgorithm( | ||
neutralPalette, | ||
14, | ||
0, | ||
neutralContrastFillHoverDelta, | ||
neutralContrastFillActiveDelta, | ||
neutralContrastFillFocusDelta, | ||
), | ||
); | ||
/** | ||
* @internal | ||
*/ | ||
export const neutralContrastFillRest: SwatchRecipe = swatchFamilyToSwatchRecipeFactory( | ||
SwatchFamilyType.rest, | ||
neutralContrastFill, | ||
); | ||
/** | ||
* @internal | ||
*/ | ||
export const neutralContrastFillHover: SwatchRecipe = swatchFamilyToSwatchRecipeFactory( | ||
SwatchFamilyType.hover, | ||
neutralContrastFill, | ||
); | ||
/** | ||
* @internal | ||
*/ | ||
export const neutralContrastFillActive: SwatchRecipe = swatchFamilyToSwatchRecipeFactory( | ||
SwatchFamilyType.active, | ||
neutralContrastFill, | ||
); | ||
/** | ||
* @internal | ||
*/ | ||
export const neutralContrastFillFocus: SwatchRecipe = swatchFamilyToSwatchRecipeFactory( | ||
SwatchFamilyType.focus, | ||
neutralContrastFill, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters