-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(components/phone-field): tokenize phone field styles (#2918)
- Loading branch information
1 parent
05a7993
commit d029b55
Showing
5 changed files
with
41 additions
and
36 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 |
---|---|---|
|
@@ -65,5 +65,5 @@ describe('phone-field-storybook', () => { | |
); | ||
}); | ||
}); | ||
}); | ||
}, true); | ||
}); |
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
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 |
---|---|---|
@@ -1,13 +1,34 @@ | ||
@use 'libs/components/theme/src/lib/styles/mixins' as mixins; | ||
@use 'libs/components/theme/src/lib/styles/variables' as *; | ||
@use 'libs/components/theme/src/lib/styles/compat-tokens-mixins' as compatMixins; | ||
@import 'node_modules/intl-tel-input/build/css/intlTelInput.css'; | ||
|
||
.sky-phone-field-country-btn + .sky-form-control { | ||
border-left: none; | ||
@include compatMixins.sky-default-overrides('.sky-phone-field-country-btn') { | ||
--sky-override-phone-field-flag-transform: scaleX(1.25) translateX(2px); | ||
--sky-override-phone-field-flag-min-width: 20px; | ||
--sky-override-phone-field-flag-display: block; | ||
--sky-override-phone-field-input-box-country-button-padding: 6px 12px; | ||
} | ||
|
||
@include compatMixins.sky-default-overrides('.sky-phone-field') { | ||
.sky-phone-field-search-btn-dismiss { | ||
border-color: transparent; | ||
} | ||
} | ||
|
||
@include compatMixins.sky-modern-overrides( | ||
'.sky-phone-field-country-btn', | ||
false | ||
) { | ||
--sky-override-phone-field-flag-transform: scaleX(1.25) translateX(2px); | ||
--sky-override-phone-field-flag-min-width: var(--modern-size-20); | ||
--sky-override-phone-field-flag-display: block; | ||
--sky-override-phone-field-input-box-country-button-padding: 0 17px 0 18px; | ||
} | ||
|
||
.sky-phone-field-country-btn { | ||
.sky-btn { | ||
// NOTE: This rule is set for non-input box phone fields. Remove when support for this is fully removed. | ||
border-radius: 0; | ||
} | ||
} | ||
|
@@ -21,47 +42,27 @@ | |
flex-grow: 1; | ||
} | ||
|
||
.sky-phone-field-search-btn-dismiss { | ||
border-color: transparent; | ||
} | ||
|
||
.sky-phone-field-country-selected, | ||
.sky-phone-field-country-default { | ||
@include mixins.sky-border(light, bottom); | ||
} | ||
|
||
.sky-phone-field-search-result { | ||
.sky-phone-field-flag { | ||
display: inline-block; | ||
margin-right: $sky-margin-half; | ||
} | ||
} | ||
|
||
// Default only style for the dismiss icon in input boxes | ||
.sky-input-box { | ||
.sky-phone-field-search-btn-dismiss .fa-lg { | ||
vertical-align: -10%; | ||
} | ||
} | ||
|
||
.sky-theme-modern { | ||
.sky-input-box { | ||
.sky-phone-field-country-search .sky-country-field-input { | ||
background-color: transparent; | ||
} | ||
|
||
.sky-phone-field-country-btn.sky-input-group-btn .sky-btn { | ||
padding: 0 17px 0 18px; | ||
} | ||
.sky-input-box { | ||
.sky-phone-field-country-btn.sky-input-group-btn .sky-btn { | ||
padding: var(--sky-override-phone-field-input-box-country-button-padding); | ||
} | ||
} | ||
|
||
.sky-phone-field-country-btn { | ||
.sky-phone-field-flag { | ||
min-width: 20px; | ||
min-width: var(--sky-override-phone-field-flag-min-width); | ||
display: var(--sky-override-phone-field-flag-display, inline-block); | ||
} | ||
|
||
.iti__flag { | ||
background-image: url(https://sky.blackbaudcdn.net/static/skyux-public-assets/1.0.0-beta.4/assets/images/intl-tel-input/[email protected]) !important; | ||
transform: scaleX(1.25) translateX(2px); | ||
transform: var(--sky-override-phone-field-flag-transform, none); | ||
} | ||
} |
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