File tree Expand file tree Collapse file tree 3 files changed +28
-2
lines changed
docs/src/stories/rails-form-framework Expand file tree Collapse file tree 3 files changed +28
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @primer/css " : patch
3+ ---
4+
5+ - Adding readonly styles
6+ - Fixing focus background color for inset field
Original file line number Diff line number Diff line change @@ -146,6 +146,13 @@ export default {
146146 table : {
147147 category : 'Input'
148148 }
149+ } ,
150+ readOnly : {
151+ description : 'readonly styles' ,
152+ control : { type : 'boolean' } ,
153+ table : {
154+ category : 'Input'
155+ }
149156 }
150157 }
151158}
@@ -173,7 +180,8 @@ export const InputTemplate = ({
173180 caption,
174181 validation,
175182 trailingActionDivider,
176- validationStatus
183+ validationStatus,
184+ readOnly
177185} ) => (
178186 < >
179187 < div className = { clsx ( 'FormControl' , fullWidth && 'FormControl--fullWidth' ) } >
@@ -212,6 +220,7 @@ export const InputTemplate = ({
212220 placeholder = { placeholder }
213221 id = "input-id"
214222 type = "text"
223+ readonly = { readOnly ? 'true' : undefined }
215224 className = { clsx (
216225 'FormControl-input' ,
217226 size && `${ size } ` ,
@@ -253,6 +262,7 @@ export const InputTemplate = ({
253262 id = "input-id"
254263 type = "text"
255264 disabled = { disabled ? 'true' : undefined }
265+ readonly = { readOnly ? 'true' : undefined }
256266 className = { clsx (
257267 'FormControl-input' ,
258268 size && `${ size } ` ,
@@ -307,5 +317,6 @@ Playground.args = {
307317 visuallyHidden : false ,
308318 validation : '' ,
309319 trailingActionDivider : false ,
310- validationStatus : 0
320+ validationStatus : 0 ,
321+ readOnly : false
311322}
Original file line number Diff line number Diff line change 133133 }
134134 }
135135
136+ & [readonly ] {
137+ background-color : var (--color-input-disabled-bg );
138+ }
139+
136140 ::placeholder {
137141 color : var (--color-fg-subtle );
138142 opacity : 1 ;
161165
162166 & .FormControl-inset {
163167 background-color : var (--color-canvas-inset );
168+
169+ & :focus-visible ,
170+ & :focus {
171+ background-color : var (--color-canvas-default );
172+ }
164173 }
165174
166175 & .FormControl-monospace {
You can’t perform that action at this time.
0 commit comments