1
1
import { 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" ;
4
4
import {
5
5
accentFillDiscernible ,
6
6
accentFillIdeal ,
@@ -116,6 +116,7 @@ import {
116
116
typeRampPlus6FontVariations ,
117
117
typeRampPlus6LineHeight ,
118
118
} from "./type.js" ;
119
+ import { densityBorderStyles , transparent } from "./util.js" ;
119
120
120
121
/**
121
122
* Style module for the shape of a control.
@@ -298,18 +299,6 @@ export const layerDensityStyles: Styles = Styles.fromProperties(
298
299
"density.layer" ,
299
300
) ;
300
301
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
-
313
302
/**
314
303
* Convenience style module for an accent-filled stealth control (interactive).
315
304
*
@@ -1295,7 +1284,7 @@ export const neutralFillReadableControlStyles: Styles = Styles.fromProperties(
1295
1284
export const neutralOutlineDiscernibleControlStyles : Styles = Styles . fromProperties (
1296
1285
{
1297
1286
...densityBorderStyles ( neutralStrokeDiscernible ) ,
1298
- ...Fill . foregroundNonInteractiveWithDisabled ( neutralStrokeStrong . rest , neutralStrokeStrong . disabled ) ,
1287
+ ...Fill . foregroundNonInteractive ( neutralStrokeStrong . rest , neutralStrokeStrong . disabled ) ,
1299
1288
backgroundFill : fillColor ,
1300
1289
} ,
1301
1290
"color.neutral-outline-discernible-control" ,
@@ -1313,7 +1302,7 @@ export const neutralOutlineDiscernibleControlStyles: Styles = Styles.fromPropert
1313
1302
*/
1314
1303
export const neutralForegroundReadableElementStyles : Styles = Styles . fromProperties (
1315
1304
{
1316
- ...Fill . foregroundNonInteractiveWithDisabled ( neutralStrokeReadable . rest , neutralStrokeReadable . disabled ) ,
1305
+ ...Fill . foregroundNonInteractive ( neutralStrokeReadable . rest , neutralStrokeReadable . disabled ) ,
1317
1306
} ,
1318
1307
"color.neutral-foreground-readable-element" ,
1319
1308
) ;
@@ -1330,7 +1319,7 @@ export const neutralForegroundReadableElementStyles: Styles = Styles.fromPropert
1330
1319
*/
1331
1320
export const neutralForegroundStrongElementStyles : Styles = Styles . fromProperties (
1332
1321
{
1333
- ...Fill . foregroundNonInteractiveWithDisabled ( neutralStrokeStrong . rest , neutralStrokeStrong . disabled ) ,
1322
+ ...Fill . foregroundNonInteractive ( neutralStrokeStrong . rest , neutralStrokeStrong . disabled ) ,
1334
1323
} ,
1335
1324
"color.neutral-foreground-strong-element" ,
1336
1325
) ;
@@ -1347,7 +1336,7 @@ export const neutralForegroundStrongElementStyles: Styles = Styles.fromPropertie
1347
1336
*/
1348
1337
export const neutralDividerSubtleElementStyles : Styles = Styles . fromProperties (
1349
1338
{
1350
- ...Fill . foregroundNonInteractiveWithDisabled ( neutralStrokeSubtle . rest , neutralStrokeStrong . disabled ) ,
1339
+ ...Fill . foregroundNonInteractive ( neutralStrokeSubtle . rest , neutralStrokeStrong . disabled ) ,
1351
1340
} ,
1352
1341
"color.neutral-divider-subtle-element" ,
1353
1342
) ;
@@ -1364,7 +1353,7 @@ export const neutralDividerSubtleElementStyles: Styles = Styles.fromProperties(
1364
1353
*/
1365
1354
export const neutralDividerDiscernibleElementStyles : Styles = Styles . fromProperties (
1366
1355
{
1367
- ...Fill . foregroundNonInteractiveWithDisabled ( neutralStrokeDiscernible . rest , neutralStrokeStrong . disabled ) ,
1356
+ ...Fill . foregroundNonInteractive ( neutralStrokeDiscernible . rest , neutralStrokeStrong . disabled ) ,
1368
1357
} ,
1369
1358
"color.neutral-divider-discernible-element" ,
1370
1359
) ;
0 commit comments