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

Added the styles for the new gutenberg-based search widget #1647

Merged
merged 3 commits into from Mar 13, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
54 changes: 47 additions & 7 deletions css/theme-bootstrap4.css
Expand Up @@ -3303,33 +3303,33 @@ fieldset:disabled .woocommerce-notices-wrapper .woocommerce-message a.button,
pointer-events: none;
}

.btn-primary, .wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button {
.btn-primary {
color: #fff;
background-color: #5533ff;
border-color: #5533ff;
}
.btn-primary:hover, .wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button:hover {
.btn-primary:hover {
color: #fff;
background-color: #350dff;
border-color: #2b00ff;
}
.btn-primary:focus, .wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button:focus, .btn-primary.focus, .wp-block-search .wp-block-search__inside-wrapper .focus.wp-block-search__button {
.btn-primary:focus, .btn-primary.focus {
color: #fff;
background-color: #350dff;
border-color: #2b00ff;
box-shadow: 0 0 0 0.2rem rgba(111, 82, 255, 0.5);
}
.btn-primary.disabled, .wp-block-search .wp-block-search__inside-wrapper .disabled.wp-block-search__button, .btn-primary:disabled, .wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button:disabled {
.btn-primary.disabled, .btn-primary:disabled {
color: #fff;
background-color: #5533ff;
border-color: #5533ff;
}
.btn-primary:not(:disabled):not(.disabled):active, .wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button:not(:disabled):not(.disabled):active, .btn-primary:not(:disabled):not(.disabled).active, .wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button:not(:disabled):not(.disabled).active, .show > .btn-primary.dropdown-toggle, .wp-block-search .wp-block-search__inside-wrapper .show > .dropdown-toggle.wp-block-search__button {
.btn-primary:not(:disabled):not(.disabled):active, .btn-primary:not(:disabled):not(.disabled).active, .show > .btn-primary.dropdown-toggle {
color: #fff;
background-color: #2b00ff;
border-color: #2800f2;
}
.btn-primary:not(:disabled):not(.disabled):active:focus, .wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button:not(:disabled):not(.disabled):active:focus, .btn-primary:not(:disabled):not(.disabled).active:focus, .wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button:not(:disabled):not(.disabled).active:focus, .show > .btn-primary.dropdown-toggle:focus, .wp-block-search .wp-block-search__inside-wrapper .show > .dropdown-toggle.wp-block-search__button:focus {
.btn-primary:not(:disabled):not(.disabled):active:focus, .btn-primary:not(:disabled):not(.disabled).active:focus, .show > .btn-primary.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(111, 82, 255, 0.5);
}

Expand Down Expand Up @@ -14227,7 +14227,7 @@ body {
background-color: #e9ecef;
}

.screen-reader-text, .wp-block-search .wp-block-search__label {
.screen-reader-text {
position: absolute;
width: 1px;
height: 1px;
Expand Down Expand Up @@ -14353,12 +14353,52 @@ article img,
}

/* Search Widget */
.wp-block-search .wp-block-search__label {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
.wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button {
border-radius: 0.25rem;
color: #fff;
background-color: #5533ff;
border-color: #5533ff;
border-top-left-radius: 0px;
border-bottom-left-radius: 0px;
}
.wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button:not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
margin-left: 0;
}
.wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button:hover {
color: #fff;
background-color: #350dff;
border-color: #2b00ff;
}
.wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button:focus, .wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button.focus {
color: #fff;
background-color: #350dff;
border-color: #2b00ff;
box-shadow: 0 0 0 0.2rem rgba(111, 82, 255, 0.5);
}
.wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button.disabled, .wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button:disabled {
color: #fff;
background-color: #5533ff;
border-color: #5533ff;
}
.wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button:not(:disabled):not(.disabled):active, .wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button:not(:disabled):not(.disabled).active, .show > .wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button.dropdown-toggle {
color: #fff;
background-color: #2b00ff;
border-color: #2800f2;
}
.wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button:not(:disabled):not(.disabled):active:focus, .wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button:not(:disabled):not(.disabled).active:focus, .show > .wp-block-search .wp-block-search__inside-wrapper .wp-block-search__button.dropdown-toggle:focus {
box-shadow: 0 0 0 0.2rem rgba(111, 82, 255, 0.5);
}

@media (max-width: 991.98px) {
body.admin-bar .offcanvas-end {
Expand Down
2 changes: 1 addition & 1 deletion css/theme-bootstrap4.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion css/theme-bootstrap4.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion css/theme-bootstrap4.min.css.map

Large diffs are not rendered by default.

52 changes: 45 additions & 7 deletions css/theme.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion css/theme.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion css/theme.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion css/theme.min.css.map

Large diffs are not rendered by default.

17 changes: 14 additions & 3 deletions src/sass/theme/_understrap.scss
Expand Up @@ -170,10 +170,14 @@ a.skip-link {
display: block;
}

/* Search Widget */
// New Search Widget in Block Editor
.wp-block-search {
.wp-block-search__label {
@extend .screen-reader-text;
@if variable-exists('bootstrap4') {
@include sr-only();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @extend would give smaller CSS.

} @else {
@include visually-hidden();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @extend would give smaller CSS.

}
}

.wp-block-search__inside-wrapper {
Expand All @@ -190,10 +194,17 @@ a.skip-link {
margin-left: 0;
}

@extend .btn-primary;
@if variable-exists('bootstrap4') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be simplified to

@include button-variant( $primary, $primary );
@if variable-exists('bootstrap4') {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

@include button-variant( $primary, $primary );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@extend .btn-primary; gives marginally smaller CSS

border-top-left-radius: 0px;
border-bottom-left-radius: 0px;
} @else {
@include button-variant( $primary, $primary );
}
}
}
}

// Fixing Off-canvas close icon is hidden behind admin bar
@include media-breakpoint-down(md) {
body.admin-bar .offcanvas-end {
Expand Down