-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat: add rounded edges and side label to S2 progress bar #6918
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
471982b
a90ca03
3e36c54
8b17caa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,26 +15,51 @@ import {centerPadding} from './style-utils' with {type: 'macro'}; | |
| export const bar = () => ({ | ||
| position: 'relative', | ||
| display: 'grid', | ||
| gridTemplateColumns: '1fr auto', | ||
| gridTemplateAreas: [ | ||
| 'label value', | ||
| 'bar bar' | ||
| ], | ||
| gridTemplateColumns: { | ||
| labelPosition: { | ||
| top: ['1fr', 'auto'], | ||
| side: ['auto', '1fr'] | ||
| } | ||
| }, | ||
| gridTemplateAreas: { | ||
| labelPosition: { | ||
| top: [ | ||
| 'label value', | ||
| 'bar bar', | ||
| ], | ||
| side: [ | ||
| 'label bar value' | ||
| ] | ||
| } | ||
| }, | ||
| alignItems: 'baseline', | ||
| isolation: 'isolate', | ||
| minWidth: 48, // progress-bar-minimum-width | ||
| maxWidth: '[768px]', // progress-bar-maximum-width | ||
| minHeight: 'control', | ||
| '--field-height': { | ||
| type: 'height', | ||
| value: 'control' | ||
| }, | ||
| '--track-to-label': { | ||
| type: 'height', | ||
| value: 4 | ||
| }, | ||
| // Spectrum defines the field label/help text with a (minimum) height, with text centered inside. | ||
| // Calculate what the gap should be based on the height and line height. | ||
| // Use a variable here rather than rowGap since it is applied to the children as padding. | ||
| // This allows the gap to collapse when the label/help text is not present. | ||
| // Eventually this may be possible to do in pure CSS: https://github.com/w3c/csswg-drafts/issues/5813 | ||
| '--field-gap': { | ||
| type: 'rowGap', | ||
| value: centerPadding() | ||
| value: centerPadding('calc(var(--field-height) + var(--track-to-label))') | ||
| }, | ||
|
|
||
| columnGap: 12 // spacing-200 | ||
| } as const); | ||
|
|
||
| export const track = () => ({ | ||
| gridArea: 'bar', | ||
| overflow: 'hidden', | ||
| marginTop: 4, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah, thought we'd just set this to 0 when no label
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah i tried that, i guess the reason i went the other route is because i didn't really want to have to add an plus i read the comment above |
||
| borderRadius: 'full', | ||
| backgroundColor: { | ||
| default: 'gray-300', | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.