Skip to content
Permalink
Browse files

Bundled Themes: Make sure button blocks respect settings.

When the original block editor styles were added to the existing default themes, the button blocks were styled to match how each theme styled the `button` tag. 

However, the styles should respect the block editor's default style, "Rounded", and allow switching to the other styles, like "Outlined" and "Square".

Props laurelfulford.
Merges [44381] to the 5.0 branch.
Fixes #45541.

git-svn-id: https://develop.svn.wordpress.org/branches/5.0@44430 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information...
SergeyBiryukov committed Jan 7, 2019
1 parent b0abd9d commit b2ba551c267ec0eb31e3fbc4aae33e0b1e82945d
@@ -232,20 +232,25 @@ p.has-drop-cap:not(:focus)::first-letter {
/* Buttons */

.wp-block-button .wp-block-button__link {
border: none;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: 0px 1px 2px rgba(0,0,0,0.3);
-moz-box-shadow: 0px 1px 2px rgba(0,0,0,0.3);
box-shadow: 0px 1px 2px rgba(0,0,0,0.3);
cursor: pointer;
font-size: 15px;
margin: 20px 0;
padding: 5px 22px;
text-decoration: none;
text-shadow: 0 -1px 0 rgba(0,0,0,0.3);
}

.wp-block-button__link {
.is-style-outline .wp-block-button__link:not(.has-text-color) {
color: #222;
text-shadow: none;
}

.wp-block-button__link,
.wp-block-button .wp-block-button__link:hover,
.wp-block-button .is-style-outline .wp-block-button__link:hover {
background: #222;
color: #eee;
}
@@ -371,14 +371,9 @@ p.has-drop-cap:not(:focus)::first-letter {
/* Buttons */

.wp-block-button .wp-block-button__link {
background: #222;
border: none;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: 0px 1px 2px rgba(0,0,0,0.3);
-moz-box-shadow: 0px 1px 2px rgba(0,0,0,0.3);
box-shadow: 0px 1px 2px rgba(0,0,0,0.3);
color: #eee;
cursor: pointer;
font-size: 15px;
line-height: 24px;
@@ -387,6 +382,19 @@ p.has-drop-cap:not(:focus)::first-letter {
text-shadow: 0 -1px 0 rgba(0,0,0,0.3);
}

.wp-block-button__link {
background: #222;
color: #eee;
}

.is-style-outline .wp-block-button__link {
color: #222;
}

.wp-block-button__link.has-text-color {
text-shadow: none;
}

/* Media & Text */

.wp-block-media-text *:last-child {
@@ -384,8 +384,6 @@ p.has-drop-cap:not(:focus)::first-letter {
/* Button */

.wp-block-button .wp-block-button__link {
border: 0;
border-radius: 0;
cursor: pointer;
font-family: "Noto Sans", sans-serif;
font-size: 12px;
@@ -397,13 +395,27 @@ p.has-drop-cap:not(:focus)::first-letter {
vertical-align: baseline;
}

.entry-content .wp-block-button:not(.is-style-outline) .wp-block-button__link {
border: 0;
}

.entry-content .wp-block-button.is-style-outline .wp-block-button__link:hover {
border-bottom: 2px solid;
}

.wp-block-button__link {
background-color: #333;
color: #fff;
}

.is-style-outline .wp-block-button__link:not(.has-text-color) {
color: #333;
}

.wp-block-button__link:hover,
.wp-block-button__link:focus {
.wp-block-button__link:focus,
.is-style-outline .wp-block-button__link:hover,
.is-style-outline .wp-block-button__link:focus {
background-color: #707070;
background-color: rgba(51, 51, 51, 0.7);
color: #fff;
@@ -708,10 +708,6 @@ p.has-drop-cap:not(:focus)::first-letter {
/* Button */

.wp-block-button .wp-block-button__link {
background-color: #333;
border: 0;
border-radius: 0;
color: #fff;
cursor: pointer;
font-family: "Noto Sans", sans-serif;
font-size: 12px;
@@ -722,6 +718,15 @@ p.has-drop-cap:not(:focus)::first-letter {
vertical-align: baseline;
}

.wp-block-button__link {
background-color: #333;
color: #fff;
}

.is-style-outline .wp-block-button__link {
color: #333;
}

@media screen and (min-width: 46.25em) {
.wp-block-button .wp-block-button__link {
font-size: 14px;
@@ -139,7 +139,6 @@ p.has-drop-cap:not(:focus)::first-letter {
.wp-block-file .wp-block-file__button {
background-color: #24890d;
border: 0;
border-radius: 2px;
color: #fff;
font-size: 12px;
font-weight: 700;
@@ -221,8 +220,6 @@ p.has-drop-cap:not(:focus)::first-letter {
/* Buttons */

.wp-block-button .wp-block-button__link {
border: 0;
border-radius: 2px;
font-size: 12px;
font-weight: 700;
line-height: 15px;
@@ -237,8 +234,14 @@ p.has-drop-cap:not(:focus)::first-letter {
color: #fff;
}

.is-style-outline .wp-block-button__link:not(.has-text-color) {
color: #24890d;
}

.wp-block-button__link:hover,
.wp-block-button__link:focus {
.wp-block-button__link:focus,
.is-style-outline .wp-block-button__link:not(.has-text-color):hover,
.is-style-outline .wp-block-button__link:not(.has-text-color):focus {
background-color: #41a62a;
color: #fff;
}
@@ -389,17 +389,22 @@ p.has-drop-cap:not(:focus)::first-letter {
/* Buttons */

.wp-block-button .wp-block-button__link {
background-color: #24890d;
border: 0;
border-radius: 2px;
color: #fff;
font-size: 12px;
font-weight: 700;
padding: 10px 30px 11px;
text-transform: uppercase;
vertical-align: bottom;
}

.wp-block-button__link {
background-color: #24890d;
color: #fff;
}

.is-style-outline .wp-block-button__link {
color: #24890d;
}

.editor-block-list__block .wp-block-button .mce-content-body {
line-height: normal;
}
@@ -189,8 +189,6 @@ p.has-drop-cap:not(:focus)::first-letter {
/* Buttons */

.wp-block-button .wp-block-button__link {
-webkit-border-radius: 2px;
border-radius: 2px;
-webkit-box-shadow: none;
box-shadow: none;
display: inline-block;
@@ -711,8 +711,6 @@ table.wp-block-table td:last-child {
/* Buttons */

.wp-block-button .wp-block-button__link {
-webkit-border-radius: 2px;
border-radius: 2px;
-webkit-box-shadow: none;
box-shadow: none;
display: inline-block;
@@ -232,13 +232,12 @@ p.has-drop-cap:not(:focus)::first-letter {
/* Buttons */

.wp-block-button .wp-block-button__link {
border: 0;
border-radius: 2px;
box-shadow: none;
font-family: Montserrat, "Helvetica Neue", sans-serif;
font-weight: 700;
letter-spacing: 0.046875em;
line-height: 1;
padding: 0.84375em 0.875em 0.78125em;
padding: 0.84375em 1.3125em 0.78125em;
text-transform: uppercase;
}

@@ -247,8 +246,20 @@ p.has-drop-cap:not(:focus)::first-letter {
color: #fff;
}

.entry-content .is-style-outline .wp-block-button__link:not(.has-background) {
background: transparent;
}

.entry-content .is-style-outline .wp-block-button__link:not(.has-text-color) {
color: #1a1a1a;
}

.entry-content .wp-block-button__link:hover,
.entry-content .wp-block-button__link:focus {
.entry-content .wp-block-button__link:focus,
.entry-content .is-style-outline .wp-block-button__link:not(.has-background):hover,
.entry-content .is-style-outline .wp-block-button__link:not(.has-background):focus,
.entry-content .is-style-outline .wp-block-button__link:not(.has-text-color):hover,
.entry-content .is-style-outline .wp-block-button__link:not(.has-text-color):focus {
background: #007acc;
color: #fff;
}
@@ -543,18 +543,23 @@ Description: Used to style blocks in the editor.
/* Buttons */

.wp-block-button .wp-block-button__link {
background: #1a1a1a;
border: 0;
border-radius: 2px;
color: #fff;
font-family: Montserrat, "Helvetica Neue", sans-serif;
font-weight: 700;
letter-spacing: 0.046875em;
line-height: 1;
padding: 0.84375em 0.875em 0.78125em;
padding: 0.84375em 1.3125em 0.78125em;
text-transform: uppercase;
}

.wp-block-button__link {
background: #1a1a1a;
color: #fff;
}

.is-style-outline .wp-block-button__link {
color: #1a1a1a;
}

/* Media & Text */

.wp-block-media-text *:last-child {
@@ -201,8 +201,8 @@ p.has-drop-cap:not(:focus)::first-letter {
background: -webkit-linear-gradient(top, #e05d22 0%, #d94412 100%); /* Chrome 10+, Safari 5.1+ */
background: linear-gradient(to bottom, #e05d22 0%, #d94412 100%); /* W3C */
border: none;
border-bottom: 3px solid #b93207;
border-radius: 2px;
border-bottom: 3px solid #b93207;
color: #fff;
display: inline-block;
font-size: 16px;
@@ -336,9 +336,7 @@ body:not(.sidebar) .wp-block-table.alignfull {
}

.wp-block-button .wp-block-button__link {
border: none;
border-bottom: 3px solid #b93207;
border-radius: 2px;
display: inline-block;
font-size: 16px;
padding: 11px 24px 10px;
@@ -350,19 +348,32 @@ body:not(.sidebar) .wp-block-table.alignfull {
color: #fff;
}

.entry-content .wp-block-button__link:not(.has-background) {
.entry-content .wp-block-button:not(.is-style-outline) .wp-block-button__link:not(.has-background) {
background: -webkit-linear-gradient(top, #e05d22 0%, #d94412 100%); /* Chrome 10+, Safari 5.1+ */
background: linear-gradient(to bottom, #e05d22 0%, #d94412 100%); /* W3C */
}

.entry-content .wp-block-button__link:hover,
.entry-content .wp-block-button__link:focus {
.entry-content .wp-block-button__link:focus,
.wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color):hover,
.wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color):focus {
background: #ed6a31;
color: #fff;
}

.wp-block-button.is-style-outline .wp-block-button__link {
background-color: inherit;
border-color: inherit;
border-width: 2px;
}

.wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color) {
color: #ed6a31;
}

.entry-content .wp-block-button__link:not(.has-background):hover,
.entry-content .wp-block-button__link:not(.has-background):hover,
.entry-content .wp-block-button__link:not(.has-background):hover {
.entry-content .wp-block-button:not(.is-style-outline) .wp-block-button__link:not(.has-background):hover {
background: -webkit-linear-gradient(top, #ed6a31 0%, #e55627 100%); /* Chrome 10+, Safari 5.1+ */
background: linear-gradient(to bottom, #ed6a31 0%, #e55627 100%); /* W3C */
}
@@ -257,7 +257,6 @@ p.has-drop-cap:not(:focus)::first-letter {
background: linear-gradient(to bottom, #e05d22 0%, #d94412 100%); /* W3C */
border: none;
border-bottom: 3px solid #b93207;
border-radius: 2px;
color: #fff;
display: inline-block;
font-size: 16px;
@@ -326,19 +325,25 @@ p.has-drop-cap:not(:focus)::first-letter {
/* Buttons */

.wp-block-button .wp-block-button__link {
background: #e05d22;
border: none;
border-bottom: 3px solid #b93207;
border-radius: 2px;
color: #fff;
display: inline-block;
font-size: 16px;
line-height: 24px;
padding: 11px 24px 10px;
text-decoration: none;
}

.wp-block-button__link:not(.has-background) {
.wp-block-button__link {
background: #e05d22;
border-bottom: 3px solid #b93207;
color: #fff;
}

.is-style-outline .wp-block-button__link {
border-width: 2px;
color: #e05d22;
}

.wp-block-button:not(.is-style-outline) .wp-block-button__link:not(.has-background) {
background: -webkit-linear-gradient(top, #e05d22 0%, #d94412 100%); /* Chrome 10+, Safari 5.1+ */
background: linear-gradient(to bottom, #e05d22 0%, #d94412 100%); /* W3C */
}

0 comments on commit b2ba551

Please sign in to comment.
You can’t perform that action at this time.