1
1
mirror of https://github.com/primer/css.git synced 2024-12-25 07:03:35 +03:00

Add styling for readonly, fix AutoComplete inset focus background color (#2218)

Co-authored-by: Eric Bailey <ericwbailey@users.noreply.github.com>
Co-authored-by: Actions Auto Build <actions@github.com>
This commit is contained in:
Katie Langerman 2022-08-29 09:57:34 -07:00 committed by GitHub
parent 8e5f622441
commit 6205337b4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 2 deletions

View File

@ -0,0 +1,6 @@
---
"@primer/css": patch
---
- Adding readonly styles
- Fixing focus background color for inset field

View File

@ -146,6 +146,13 @@ export default {
table: {
category: 'Input'
}
},
readOnly: {
description: 'readonly styles',
control: {type: 'boolean'},
table: {
category: 'Input'
}
}
}
}
@ -173,7 +180,8 @@ export const InputTemplate = ({
caption,
validation,
trailingActionDivider,
validationStatus
validationStatus,
readOnly
}) => (
<>
<div className={clsx('FormControl', fullWidth && 'FormControl--fullWidth')}>
@ -212,6 +220,7 @@ export const InputTemplate = ({
placeholder={placeholder}
id="input-id"
type="text"
readonly={readOnly ? 'true' : undefined}
className={clsx(
'FormControl-input',
size && `${size}`,
@ -253,6 +262,7 @@ export const InputTemplate = ({
id="input-id"
type="text"
disabled={disabled ? 'true' : undefined}
readonly={readOnly ? 'true' : undefined}
className={clsx(
'FormControl-input',
size && `${size}`,
@ -307,5 +317,6 @@ Playground.args = {
visuallyHidden: false,
validation: '',
trailingActionDivider: false,
validationStatus: 0
validationStatus: 0,
readOnly: false
}

View File

@ -133,6 +133,10 @@
}
}
&[readonly] {
background-color: var(--color-input-disabled-bg);
}
::placeholder {
color: var(--color-fg-subtle);
opacity: 1;
@ -161,6 +165,11 @@
&.FormControl-inset {
background-color: var(--color-canvas-inset);
&:focus-visible,
&:focus {
background-color: var(--color-canvas-default);
}
}
&.FormControl-monospace {