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

style(component): 1 . added a new class modifier searchfield #149

Merged
merged 6 commits into from
Apr 2, 2020
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
25 changes: 24 additions & 1 deletion src/elements/search/SearchPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,29 @@ function SearchPage() {
const themes = ['indigo', 'yellow', 'red'];
return (
<>
<div style={{ padding: 30, background: '#fff', marginBottom: 15 }}>
<p style={{ color: '#FFF' }}>Search Default</p>
{themes.map(elem => (
<div
className={`theme-${elem} zep-search`}
style={{ marginBottom: 15 }}
key={elem}
>
<input
type="text"
className="zep-search__input zep-search__input--rounded-left"
placeholder="Search"
id={`search-${elem}`}
/>
<Icon icon="zepicons-search" className="zep-search__icon" />
<label className="zep-visually-hidden" htmlFor={`search-${elem}`}>
Search {elem}
</label>
</div>
))}
</div>

<p>Header Default</p>
{themes.map(elem => (
<div
className={`theme-${elem} zep-search`}
Expand All @@ -13,7 +36,7 @@ function SearchPage() {
>
<input
type="text"
className="zep-search__input"
className="zep-search__input zep-search__input--searchfield"
placeholder="Search"
id={`search-${elem}`}
/>
Expand Down
47 changes: 28 additions & 19 deletions src/elements/search/_search.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,48 @@

.#{$prefix}search__input {
@extend %typo-normal-body1;
color: map-deep-get($guidelines, 'color', 'font');
color: rgba($color: #000000, $alpha: 0.6);
width: 100%;
height: 3rem;
border: none;
background-color: white;
padding-left: 1.25rem;
padding-left: 3.25rem;
padding-top: 0.25rem;
border-bottom: 3px solid;
border-bottom-color: map-deep-get(
$guidelines,
'color',
'global',
lightGray
);
@include themify($color_themes) {
border: 1px solid rgba($color: #000000, $alpha: 0.6);
&--rounded-left {
background: rgb(255, 255, 255);
border-radius: 30px 0px 0px 30px;
&:focus {
border-bottom-color: themed('primary');
@extend %typo-bold-body1;
border: 2px solid rgba($color: #000000, $alpha: 0.8);
outline: none;
+ .#{$prefix}search__icon {
color: rgba($color: #000000, $alpha: 0.8);
}
}
&:focus + .#{$prefix}search__icon {
color: themed('primary');
}
&--searchfield {
border: none;
padding-left: 1.25rem;
border-bottom: 1px solid rgba($color: #000000, $alpha: 0.6);
&:focus {
border-bottom: 2px solid rgba($color: #000000, $alpha: 0.8);
outline: none;
+ .#{$prefix}search__icon {
color: rgba($color: #000000, $alpha: 0.8);
}
}
+ .#{$prefix}search__icon {
right: 0;
left: unset;
}
}
}

.#{$prefix}search__icon {
position: absolute;
top: 11px;
right: 0;
top: 15px;
left: 20px;
width: 24px;
height: 24px;
color: black;
color: rgba($color: #000000, $alpha: 0.6);
}
}

Expand Down