Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: Use logical properties for Search Field, Select, Text Area and Text Input #1226

Merged
merged 6 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/css/src/components/search-field/search-field.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
font-family: var(--ams-search-field-input-font-family);
font-size: var(--ams-search-field-input-font-size);
font-weight: var(--ams-search-field-input-font-weight);
inline-size: 100%;
line-height: var(--ams-search-field-input-line-height);
outline-offset: var(--ams-search-field-input-outline-offset);
padding-block: var(--ams-search-field-input-padding-block);
padding-inline: var(--ams-search-field-input-padding-inline);
touch-action: manipulation;
width: 100%;

@include text-rendering;
@include reset-input;
Expand All @@ -53,10 +53,10 @@
.ams-search-field__input::-webkit-search-cancel-button {
appearance: none;
background-image: var(--ams-search-field-input-cancel-button-background-image);
block-size: var(--ams-search-field-input-cancel-button-block-size);
cursor: pointer;
height: var(--ams-search-field-input-cancel-button-height);
inline-size: var(--ams-search-field-input-cancel-button-inline-size);
margin-inline-start: 0.5rem;
width: var(--ams-search-field-input-cancel-button-width);
}

@mixin reset-button {
Expand Down
2 changes: 1 addition & 1 deletion packages/css/src/components/select/select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
font-family: var(--ams-select-font-family);
font-size: var(--ams-select-font-size);
font-weight: var(--ams-select-font-weight);
inline-size: 100%;
line-height: var(--ams-select-line-height);
max-inline-size: 100%;
outline-offset: var(--ams-select-outline-offset);
padding-block: var(--ams-select-padding-block);
padding-inline: var(--ams-select-padding-inline);
Expand Down
8 changes: 4 additions & 4 deletions packages/css/src/components/text-area/text-area.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
font-family: var(--ams-text-area-font-family);
font-size: var(--ams-text-area-font-size);
font-weight: var(--ams-text-area-font-weight);
inline-size: 100%;
line-height: var(--ams-text-area-line-height);
max-width: 100%;
min-height: var(--ams-text-area-min-height);
max-inline-size: 100%; // This prevents overflow when using the `cols` prop
min-block-size: var(--ams-text-area-min-block-size);
outline-offset: var(--ams-text-area-outline-offset);
padding-block: var(--ams-text-area-padding-block);
padding-inline: var(--ams-text-area-padding-inline);
touch-action: manipulation;
width: 100%;

@include text-rendering;
@include reset;
Expand Down Expand Up @@ -69,5 +69,5 @@
}

.ams-text-area--cols {
width: auto;
inline-size: auto;
}
2 changes: 1 addition & 1 deletion packages/css/src/components/text-input/text-input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
font-family: var(--ams-text-input-font-family);
font-size: var(--ams-text-input-font-size);
font-weight: var(--ams-text-input-font-weight);
inline-size: 100%;
line-height: var(--ams-text-input-line-height);
outline-offset: var(--ams-text-input-outline-offset);
padding-block: var(--ams-text-input-padding-block);
padding-inline: var(--ams-text-input-padding-inline);
touch-action: manipulation;
width: 100%;

@include text-rendering;
@include reset;
Expand Down
10 changes: 5 additions & 5 deletions proprietary/tokens/src/components/ams/search-field.tokens.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
"background-color": { "value": "{ams.color.primary-blue}" },
"color": { "value": "{ams.color.primary-white}" },
"outline-offset": { "value": "{ams.focus.outline-offset}" },
"padding-block": { "value": "{ams.space.inside.xs}" },
"padding-inline": { "value": "{ams.space.inside.xs}" },
"hover": {
"background-color": { "value": "{ams.color.dark-blue}" }
},
"padding-block": { "value": "{ams.space.inside.xs}" },
"padding-inline": { "value": "{ams.space.inside.xs}" }
}
},
"input": {
"background-color": { "value": "{ams.color.primary-white}" },
Expand All @@ -28,9 +28,9 @@
"background-image": {
"value": "url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><path fill='%23004699' fill-rule='evenodd' d='M29.333 5.47 26.53 2.668 16 13.187 5.47 2.666 2.668 5.47 13.187 16 2.666 26.53l2.804 2.803L16 18.813l10.53 10.52 2.803-2.804L18.813 16z'/></svg>\")"
},
"block-size": { "value": "{ams.text.level.5.font-size}" },
"color": { "value": "{ams.color.primary-blue}" },
"height": { "value": "{ams.text.level.5.font-size}" },
"width": { "value": "{ams.text.level.5.font-size}" }
"inline-size": { "value": "{ams.text.level.5.font-size}" }
},
"hover": {
"box-shadow": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"font-size": { "value": "{ams.text.level.5.font-size}" },
"font-weight": { "value": "{ams.text.font-weight.normal}" },
"line-height": { "value": "{ams.text.level.5.line-height}" },
"min-height": {
"min-block-size": {
"value": "calc({ams.text.level.5.line-height} * 1em + 2 * {ams.text-area.padding-block})"
},
"outline-offset": { "value": "{ams.focus.outline-offset}" },
Expand Down
Loading