Skip to content

Commit a8fc49b

Browse files
committed
Style disabled & read only input (#180)
1 parent e707774 commit a8fc49b

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

src/elements/forms/text-field.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,18 @@ label {
7777
}
7878
}
7979

80+
input:disabled,
81+
input:read-only,
82+
input:disabled + label,
83+
input:read-only + label {
84+
--form-control-color: var(--gray-500);
85+
--form-label-color: var(--gray-500);
86+
}
87+
88+
input:disabled {
89+
cursor: not-allowed;
90+
}
91+
8092
/* Size variations */
8193

8294
.small {

src/elements/forms/text-field.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,19 @@ Example with success message:
6464
/>
6565
```
6666

67+
Example with disabled input:
68+
69+
```jsx
70+
<TextField
71+
id="disabled-input"
72+
name="disabled-input"
73+
label="Disabled input"
74+
value="Disabled input"
75+
variant="success"
76+
disabled
77+
/>
78+
```
79+
6780
### Size variations
6881

6982
#### Small

0 commit comments

Comments
 (0)