Skip to content

Commit

Permalink
Geologist: code quality (#4532)
Browse files Browse the repository at this point in the history
* refactor outline button styles

* removed block patterns styles

* renamed mixin
  • Loading branch information
MaggieCabrera authored Sep 7, 2021
1 parent bc17b04 commit 76a8d2f
Show file tree
Hide file tree
Showing 15 changed files with 81 additions and 438 deletions.
15 changes: 15 additions & 0 deletions blockbase/sass/blocks/_button-mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,18 @@
}
}
}

//Mixins for the alternative outline style
@mixin button-outline-hover-styles {
&:hover,
&:focus,
&.has-focus {
border-style: var(--wp--custom--button--border--style);
border-color: currentColor;
border-width: var(--wp--custom--button--border--width);
padding-top: var(--wp--custom--button--spacing--padding--top);
padding-bottom: var(--wp--custom--button--spacing--padding--bottom);
padding-left: var(--wp--custom--button--spacing--padding--left);
padding-right: var(--wp--custom--button--spacing--padding--right);
}
}
41 changes: 41 additions & 0 deletions blockbase/sass/blocks/_buttons-outline-style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
@import 'button-mixins';
.wp-block-button {
&.wp-block-button__link,
.wp-block-button__link {
&:not(.has-background):not(.has-text-color) {
@include button-outline-hover-styles;
}
}
}
.wp-block-file .wp-block-file__button {
@include button-outline-hover-styles;
}

.wp-block-search {
&.wp-block-search__button-inside .wp-block-search__inside-wrapper .wp-block-search__button,
.wp-block-search__button {
@include button-outline-hover-styles;
}
}

.wp-block-post-comments {
input[type="submit"], .reply a {
@include button-outline-hover-styles;
}
}

//NOTE: Double-classed to raise specificity above parent theme's outline hover styles
//as an alternative to !important. Only needed for the editor.
.wp-block-button.wp-block-button.is-style-outline {
&.wp-block-button__link,
.wp-block-button__link {
&:not(.has-background):not(.has-text-color) {
&:hover,
&:focus,
&.has-focus {
color: var(--wp--custom--button--color--background);
background-color: var(--wp--custom--button--color--text);
}
}
}
}
138 changes: 0 additions & 138 deletions geologist/assets/theme.css

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

6 changes: 0 additions & 6 deletions geologist/sass/block-patterns/_headlines.scss

This file was deleted.

3 changes: 0 additions & 3 deletions geologist/sass/block-patterns/_join.scss

This file was deleted.

42 changes: 0 additions & 42 deletions geologist/sass/block-styles/_cover.scss

This file was deleted.

78 changes: 0 additions & 78 deletions geologist/sass/block-styles/_query.scss

This file was deleted.

53 changes: 0 additions & 53 deletions geologist/sass/blocks/_buttons.scss

This file was deleted.

Loading

0 comments on commit 76a8d2f

Please sign in to comment.