11import { ValuesOf } from "@microsoft/fast-foundation" ;
2- import { Fill , Styles , StyleValue } from "../core/modules/styles.js" ;
3- import { cornerRadiusControl , cornerRadiusLayer , focusStrokeThickness , strokeThickness } from "./appearance.js" ;
2+ import { Fill , Styles } from "../core/modules/styles.js" ;
3+ import { cornerRadiusControl , cornerRadiusLayer , focusStrokeThickness } from "./appearance.js" ;
44import {
55 accentFillDiscernible ,
66 accentFillIdeal ,
@@ -116,6 +116,7 @@ import {
116116 typeRampPlus6FontVariations ,
117117 typeRampPlus6LineHeight ,
118118} from "./type.js" ;
119+ import { densityBorderStyles , transparent } from "./util.js" ;
119120
120121/**
121122 * Style module for the shape of a control.
@@ -298,18 +299,6 @@ export const layerDensityStyles: Styles = Styles.fromProperties(
298299 "density.layer" ,
299300) ;
300301
301- const transparent = "transparent" ;
302-
303- // TODO: There's a bit of an overlap right now where density calculations assume a border thickness,
304- // but setting the color is done elsewhere or not at all, producing inconsistent and unpredictable styling.
305- const densityBorderStyles = ( fillValue : StyleValue ) => {
306- return {
307- borderThickness : strokeThickness ,
308- borderStyle : "solid" ,
309- borderFill : fillValue ,
310- }
311- } ;
312-
313302/**
314303 * Convenience style module for an accent-filled stealth control (interactive).
315304 *
@@ -1295,7 +1284,7 @@ export const neutralFillReadableControlStyles: Styles = Styles.fromProperties(
12951284export const neutralOutlineDiscernibleControlStyles : Styles = Styles . fromProperties (
12961285 {
12971286 ...densityBorderStyles ( neutralStrokeDiscernible ) ,
1298- ...Fill . foregroundNonInteractiveWithDisabled ( neutralStrokeStrong . rest , neutralStrokeStrong . disabled ) ,
1287+ ...Fill . foregroundNonInteractive ( neutralStrokeStrong . rest , neutralStrokeStrong . disabled ) ,
12991288 backgroundFill : fillColor ,
13001289 } ,
13011290 "color.neutral-outline-discernible-control" ,
@@ -1313,7 +1302,7 @@ export const neutralOutlineDiscernibleControlStyles: Styles = Styles.fromPropert
13131302 */
13141303export const neutralForegroundReadableElementStyles : Styles = Styles . fromProperties (
13151304 {
1316- ...Fill . foregroundNonInteractiveWithDisabled ( neutralStrokeReadable . rest , neutralStrokeReadable . disabled ) ,
1305+ ...Fill . foregroundNonInteractive ( neutralStrokeReadable . rest , neutralStrokeReadable . disabled ) ,
13171306 } ,
13181307 "color.neutral-foreground-readable-element" ,
13191308) ;
@@ -1330,7 +1319,7 @@ export const neutralForegroundReadableElementStyles: Styles = Styles.fromPropert
13301319 */
13311320export const neutralForegroundStrongElementStyles : Styles = Styles . fromProperties (
13321321 {
1333- ...Fill . foregroundNonInteractiveWithDisabled ( neutralStrokeStrong . rest , neutralStrokeStrong . disabled ) ,
1322+ ...Fill . foregroundNonInteractive ( neutralStrokeStrong . rest , neutralStrokeStrong . disabled ) ,
13341323 } ,
13351324 "color.neutral-foreground-strong-element" ,
13361325) ;
@@ -1347,7 +1336,7 @@ export const neutralForegroundStrongElementStyles: Styles = Styles.fromPropertie
13471336 */
13481337export const neutralDividerSubtleElementStyles : Styles = Styles . fromProperties (
13491338 {
1350- ...Fill . foregroundNonInteractiveWithDisabled ( neutralStrokeSubtle . rest , neutralStrokeStrong . disabled ) ,
1339+ ...Fill . foregroundNonInteractive ( neutralStrokeSubtle . rest , neutralStrokeStrong . disabled ) ,
13511340 } ,
13521341 "color.neutral-divider-subtle-element" ,
13531342) ;
@@ -1364,7 +1353,7 @@ export const neutralDividerSubtleElementStyles: Styles = Styles.fromProperties(
13641353 */
13651354export const neutralDividerDiscernibleElementStyles : Styles = Styles . fromProperties (
13661355 {
1367- ...Fill . foregroundNonInteractiveWithDisabled ( neutralStrokeDiscernible . rest , neutralStrokeStrong . disabled ) ,
1356+ ...Fill . foregroundNonInteractive ( neutralStrokeDiscernible . rest , neutralStrokeStrong . disabled ) ,
13681357 } ,
13691358 "color.neutral-divider-discernible-element" ,
13701359) ;
0 commit comments