-
Notifications
You must be signed in to change notification settings - Fork 550
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(FormControl): update FormControl to use CSS Modules behind f…
…lag (#5438) * refactor: move form control test files into folder * refactor(FormControl): update FormControl to use CSS Modules behind flag * refactor(InputLabel): update InputLabel to use CSS Modules behind feature flag * refactor(FormControl): update Caption to use CSS Modules behind feature flag * refactor(InputValidation): refactor InputValidation to CSS Modules behind feature flag * chore: add changeset * Apply suggestions from code review Co-authored-by: Katie Langerman <[email protected]> * chore: update stylelint violations * fix: update selector for leading visual * add missing sx prop --------- Co-authored-by: Katie Langerman <[email protected]> Co-authored-by: Hussam Ghazzi <[email protected]>
- Loading branch information
1 parent
83386f4
commit 4776d13
Showing
12 changed files
with
404 additions
and
140 deletions.
There are no files selected for viewing
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,5 @@ | ||
--- | ||
"@primer/react": minor | ||
--- | ||
|
||
Update FormControl to use CSS Modules behind feature flag |
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,57 @@ | ||
.ControlHorizontalLayout { | ||
display: flex; | ||
|
||
&:where([data-has-leading-visual]) { | ||
align-items: center; | ||
} | ||
} | ||
|
||
.ControlVerticalLayout { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
|
||
& > *:not(label) + * { | ||
margin-top: var(--base-size-4); | ||
} | ||
|
||
&[data-has-label] > * + * { | ||
margin-top: var(--base-size-4); | ||
} | ||
} | ||
|
||
.ControlChoiceInputs > input { | ||
margin-right: 0; | ||
margin-left: 0; | ||
} | ||
|
||
.LabelContainer { | ||
> * { | ||
/* stylelint-disable-next-line primer/spacing */ | ||
padding-left: var(--stack-gap-condensed); | ||
} | ||
|
||
> label { | ||
font-weight: var(--base-text-weight-normal); | ||
} | ||
} | ||
|
||
.LeadingVisual { | ||
margin-left: var(--base-size-8); | ||
color: var(--fgColor-muted); | ||
|
||
&:where([data-disabled]) { | ||
color: var(--control-fgColor-disabled); | ||
} | ||
|
||
> * { | ||
min-width: var(--text-body-size-large); | ||
min-height: var(--text-body-size-large); | ||
fill: currentColor; | ||
} | ||
|
||
> *:where([data-has-caption]) { | ||
min-width: var(--base-size-24); | ||
min-height: var(--base-size-24); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.Caption { | ||
display: block; | ||
font-size: var(--text-body-size-small); | ||
color: var(--fgColor-muted); | ||
|
||
&:where([data-control-disabled]) { | ||
color: var(--control-fgColor-disabled); | ||
} | ||
} |
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
Oops, something went wrong.