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

fix(search): add styles for custom search buttons #3247

Merged
merged 8 commits into from
Jul 2, 2019
72 changes: 46 additions & 26 deletions packages/components/src/components/search/_search.scss
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,40 @@
.#{$prefix}--search-close {
@include button-reset(false);
@include focus-outline('reset');
position: absolute;
right: 0;

&::before {
content: '';
display: block;
position: absolute;
left: 0;
top: rem(1px);
height: calc(100% - 2px);
width: 2px;
background-color: $field-01;
transition: background-color $duration--fast-02
motion(standard, productive);
}

&:hover {
border-bottom: 1px solid $ui-04;
}
}

.#{$prefix}--search-button {
flex-shrink: 0;
margin-left: $carbon--spacing-01;
background-color: $field-01;

svg {
vertical-align: middle;
fill: currentColor;
}
}

.#{$prefix}--search-close,
.#{$prefix}--search-button {
display: flex;
align-items: center;
justify-content: center;
Expand All @@ -124,17 +158,14 @@
cursor: pointer;
visibility: visible;
opacity: 1;
position: absolute;
height: rem(40px);
width: rem(40px);
right: 0;
fill: $icon-01;
border: 1px solid transparent;
border-left: 0;

&:hover {
background-color: $hover-field;
border-bottom: 1px solid $ui-04;
}

&:focus {
Expand All @@ -145,19 +176,6 @@
@include focus-outline('outline');
background-color: $selected-ui;
}

&::before {
content: '';
display: block;
position: absolute;
left: 0;
top: rem(1px);
height: calc(100% - 2px);
width: 2px;
background-color: $field-01;
transition: background-color $duration--fast-02
motion(standard, productive);
}
}

.#{$prefix}--search-close:hover {
Expand All @@ -177,18 +195,20 @@
@include focus-outline('outline');
}

.#{$prefix}--search--sm .#{$prefix}--search-close {
height: rem(32px);
width: rem(32px);
}

.#{$prefix}--search--xl .#{$prefix}--search-close {
height: rem(48px);
width: rem(48px);
.#{$prefix}--search--sm {
.#{$prefix}--search-close,
~ .#{$prefix}--search-button {
height: rem(32px);
width: rem(32px);
}
}

.#{$prefix}--search-close:focus {
@include focus-outline('outline');
.#{$prefix}--search--xl {
.#{$prefix}--search-close,
~ .#{$prefix}--search-button {
height: rem(48px);
width: rem(48px);
}
}

.#{$prefix}--search-close--hidden {
Expand Down