-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change Multiselect parent classname base
- Loading branch information
Showing
12 changed files
with
272 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* Import WordPress base styles */ | ||
@import '../../node_modules/@wordpress/base-styles/colors'; | ||
@import '../../node_modules/@wordpress/base-styles/variables'; | ||
@import '../../node_modules/@wordpress/base-styles/mixins'; | ||
@import '../../node_modules/@wordpress/base-styles/breakpoints'; | ||
@import '../../node_modules/@wordpress/base-styles/animations'; | ||
@import '../../node_modules/@wordpress/base-styles/z-index'; | ||
@import '../../node_modules/@wordpress/base-styles/default-custom-properties'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,192 @@ | ||
@import '../base-styles/style.scss'; | ||
// TODO - needs renaming for layouts + templates (some sort of base class?) | ||
|
||
.codeamp-components-multiselect-control { | ||
&__label { | ||
display: inline-block; | ||
margin-bottom: 4px; | ||
} | ||
|
||
&__input_container { | ||
font-size: 13px; | ||
line-height: normal; | ||
} | ||
} | ||
|
||
|
||
.codeamp-components-multiselect-control__input-container { | ||
@include input-control(); | ||
width: 100%; | ||
margin: 0 0 $grid-unit-10 0; | ||
padding: 0; | ||
cursor: text; | ||
|
||
&.is-disabled { | ||
background: $gray-300; | ||
border-color: $gray-300; | ||
} | ||
|
||
&.is-active { | ||
@include input-style__focus(); | ||
} | ||
// Token input | ||
input[type="text"].codeamp-components-multiselect-control__input { | ||
display: inline-block; | ||
flex: 1; | ||
font-family: inherit; | ||
font-size: 16px; | ||
width: 100%; | ||
max-width: 100%; | ||
margin-left: 4px; | ||
padding: 0; | ||
min-height: 24px; | ||
min-width: 50px; | ||
background: inherit; | ||
border: 0; | ||
color: $gray-900; | ||
box-shadow: none; | ||
|
||
// Resolves Zooming on iOS devices | ||
// https://github.com/WordPress/gutenberg/issues/27405 | ||
@include break-small() { | ||
font-size: 13px; | ||
} | ||
|
||
&:focus, | ||
.codeamp-components-multiselect-control.is-active & { | ||
outline: none; | ||
box-shadow: none; | ||
} | ||
} | ||
.codeamp-components-multiselect-control__token + input[type="text"].codeamp-components-multiselect-control__input { | ||
width: auto; | ||
} | ||
} | ||
|
||
.codeamp-components-multiselect-control__help { | ||
font-size: $helptext-font-size; | ||
font-style: normal; | ||
color: $gray-700; | ||
} | ||
|
||
|
||
// Tokens | ||
.codeamp-components-multiselect-control__tokens-container { | ||
padding: 4px; | ||
} | ||
|
||
.codeamp-components-multiselect-control__token { | ||
font-size: $default-font-size; | ||
display: flex; | ||
color: $gray-900; | ||
max-width: 100%; | ||
|
||
&.is-borderless { | ||
position: relative; | ||
padding: 0 24px 0 0; | ||
|
||
.codeamp-components-multiselect-control__token-text { | ||
background: transparent; | ||
color: var(--wp-admin-theme-color); | ||
} | ||
|
||
.codeamp-components-multiselect-control__remove-token { | ||
background: transparent; | ||
color: $gray-700; | ||
position: absolute; | ||
top: 1px; | ||
right: 0; | ||
padding: 0; | ||
} | ||
|
||
&.is-success { | ||
.codeamp-components-multiselect-control__token-text { | ||
color: $alert-green; | ||
} | ||
} | ||
|
||
&.is-error { | ||
.codeamp-components-multiselect-control__token-text { | ||
color: $alert-red; | ||
border-radius: 4px 0 0 4px; | ||
padding: 0 4px 0 6px; | ||
} | ||
} | ||
|
||
&.is-validating { | ||
.codeamp-components-multiselect-control__token-text { | ||
color: $gray-900; | ||
} | ||
} | ||
} | ||
|
||
&.is-disabled { | ||
.codeamp-components-multiselect-control__remove-token { | ||
cursor: default; | ||
} | ||
} | ||
} | ||
|
||
.codeamp-components-multiselect-control__token-text, | ||
.codeamp-components-multiselect-control__remove-token.components-button { | ||
display: inline-block; | ||
line-height: 24px; | ||
height: auto; | ||
background: $gray-300; | ||
min-width: unset; | ||
transition: all 0.2s cubic-bezier(0.4, 1, 0.4, 1); | ||
@include reduce-motion; | ||
} | ||
|
||
.codeamp-components-multiselect-control__token-text { | ||
border-radius: 2px 0 0 2px; | ||
padding: 0 0 0 8px; | ||
white-space: nowrap; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
} | ||
|
||
.codeamp-components-multiselect-control__remove-token.components-button { | ||
cursor: pointer; | ||
border-radius: 0 2px 2px 0; | ||
padding: 0 2px; | ||
color: $gray-900; | ||
line-height: 10px; | ||
overflow: initial; | ||
|
||
&:hover { | ||
color: $gray-900; | ||
} | ||
} | ||
|
||
// Suggestion list | ||
.codeamp-components-multiselect-control__suggestions-list { | ||
flex: 1 0 100%; | ||
min-width: 100%; | ||
max-height: 9em; | ||
overflow-y: auto; | ||
transition: all 0.15s ease-in-out; | ||
@include reduce-motion("transition"); | ||
list-style: none; | ||
border-top: $border-width solid $gray-700; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
.codeamp-components-multiselect-control__suggestion { | ||
color: $gray-700; | ||
display: block; | ||
font-size: $default-font-size; | ||
padding: 4px 8px; | ||
margin: 0; | ||
cursor: pointer; | ||
|
||
&.is-selected { | ||
background: var(--wp-admin-theme-color); | ||
color: $white; | ||
} | ||
} | ||
|
||
.codeamp-components-multiselect-control__suggestion-match { | ||
text-decoration: underline; | ||
} |
Oops, something went wrong.