mirror of
https://github.com/primer/css.git
synced 2025-01-05 21:22:57 +03:00
Add disabled state to .form-control
This commit is contained in:
parent
0826b442d1
commit
0b8beb76e3
@ -76,12 +76,17 @@ Textual form controls have a white background by default. You can change this to
|
||||
```html live
|
||||
<form>
|
||||
<input class="form-control" type="text" placeholder="Default input" aria-label="Default input" />
|
||||
<input
|
||||
class="form-control input-contrast"
|
||||
type="text"
|
||||
placeholder="Input with contrast"
|
||||
aria-label="Input with contrast"
|
||||
/>
|
||||
<input class="form-control input-contrast" type="text" placeholder="Input with contrast" aria-label="Input with contrast" />
|
||||
</form>
|
||||
```
|
||||
|
||||
#### Disabled state
|
||||
|
||||
Add the `disabled` attribute to make a `.form-control` appear disabled.
|
||||
|
||||
```html live
|
||||
<form>
|
||||
<input class="form-control" type="text" placeholder="Disabled input" aria-label="Disabled input" disabled />
|
||||
</form>
|
||||
```
|
||||
|
||||
|
@ -39,6 +39,13 @@ label {
|
||||
box-shadow: $focus-shadow;
|
||||
}
|
||||
|
||||
&[disabled] {
|
||||
// stylelint-disable-next-line primer/colors
|
||||
color: $gray-400;
|
||||
// stylelint-disable-next-line primer/colors
|
||||
background-color: #f3f4f6; // custom gray
|
||||
}
|
||||
|
||||
// Ensures inputs don't zoom on mobile but are body-font size on desktop
|
||||
@include breakpoint(md) {
|
||||
font-size: $body-font-size;
|
||||
|
Loading…
Reference in New Issue
Block a user