Skip to content

Commit

Permalink
Scale number field step glyph
Browse files Browse the repository at this point in the history
  • Loading branch information
fcollonval committed Jul 29, 2024
1 parent efd5e88 commit 02519fd
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions packages/components/src/number-field/number-field.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ import {
FoundationElementTemplate,
NumberFieldOptions
} from '@microsoft/fast-foundation';
import { neutralForegroundRest } from '../design-tokens.js';
import {
density,
designUnit,
elementScale,
neutralFillActive,
neutralFillHover,
neutralForegroundRest
} from '../design-tokens.js';
import { BaseFieldStyles } from '../styles/index.js';

/**
Expand All @@ -22,20 +29,35 @@ export const numberFieldStyles: FoundationElementTemplate<
.controls {
opacity: 0;
margin: auto 0;
}
.step-up-glyph,
.step-down-glyph {
display: block;
padding: 4px 10px;
padding: calc(
(${designUnit} + 0.5 * ${density} + 0.5 * ${elementScale}) * 1px
)
calc((2 + 2 * ${designUnit} + ${density} + ${elementScale}) * 1px);
cursor: pointer;
}
.step-up-glyph:before,
.step-down-glyph:before {
content: '';
display: block;
border: solid transparent 6px;
border: solid transparent
calc((2 + ${designUnit} + 0.5 * ${density} + 0.5 * ${elementScale}) * 1px);
}
.step-up-glyph:hover:before,
.step-down-glyph:hover:before {
background-color: ${neutralFillHover};
}
.step-up-glyph:active:before,
.step-down-glyph:active:before {
background-color: ${neutralFillActive};
}
.step-up-glyph:before {
Expand Down

0 comments on commit 02519fd

Please sign in to comment.