@@ -86,69 +86,37 @@ $blocks-block__margin: 0.5em;
86
86
}
87
87
}
88
88
89
- // the first selector is required for old buttons markup
89
+ // The follow block style selectors are required for old buttons markup
90
+ // and do not use the `:root :where()` format to match specificity at
91
+ // the time they were deprecated.
90
92
.wp-block-button.is-style-squared ,
91
93
.wp-block-button__link.wp-block-button.is-style-squared {
92
94
border-radius : 0 ;
93
95
}
94
-
95
- // the first selector is required for old buttons markup
96
96
.wp-block-button.no-border-radius ,
97
97
.wp-block-button__link.no-border-radius {
98
98
border-radius : 0 !important ;
99
99
}
100
100
101
- .wp-block-button :where(.is-style-outline ) > .wp-block-button__link ,
102
- .wp-block-button .wp-block-button__link :where(.is-style-outline ) {
103
- border : 2px solid currentColor ;
104
- padding : 0.667em 1.333em ;
105
- }
106
-
107
- .wp-block-button :where(.is-style-outline ) > .wp-block-button__link :not (.has-text-color ),
108
- .wp-block-button .wp-block-button__link :where(.is-style-outline ):not (.has-text-color ) {
109
- color : currentColor ;
110
- }
111
-
112
- .wp-block-button :where(.is-style-outline ) > .wp-block-button__link :not (.has-background ),
113
- .wp-block-button .wp-block-button__link :where(.is-style-outline ):not (.has-background ) {
114
- background-color : transparent ;
115
- // background-image is required to overwrite a gradient background
116
- background-image : none ;
117
- }
118
-
119
- .wp-block-button .wp-block-button__link {
120
- // The following styles ensure a default border is applied when the user
121
- // selects only a border color or style. This overcomes the zero border
122
- // width applied by core's theme.json via the elements API.
123
- & :where (.has-border-color ) {
124
- border-width : initial ;
125
- }
126
- & :where([style *= " border-top-color" ]) {
127
- border-top-width : initial ;
128
- }
129
- & :where([style *= " border-right-color" ]) {
130
- border-right-width : initial ;
131
- }
132
- & :where([style *= " border-bottom-color" ]) {
133
- border-bottom-width : initial ;
134
- }
135
- & :where([style *= " border-left-color" ]) {
136
- border-left-width : initial ;
101
+ // Selectors here use the `:root :where()` format for maintaining compatibility
102
+ // with global styles and nested block style variations.
103
+ :root {
104
+ // Outline Block Style Variation.
105
+ :where (.wp-block-button.is-style-outline > .wp-block-button__link ),
106
+ :where (.wp-block-button .wp-block-button__link.is-style-outline ) {
107
+ border : 2px solid currentColor ;
108
+ padding : 0.667em 1.333em ;
137
109
}
138
110
139
- & :where([style *= " border-style" ]) {
140
- border-width : initial ;
141
- }
142
- & :where([style *= " border-top-style" ]) {
143
- border-top-width : initial ;
111
+ :where(.wp-block-button.is-style-outline > .wp-block-button__link :not (.has-text-color )),
112
+ :where(.wp-block-button .wp-block-button__link.is-style-outline :not (.has-text-color )) {
113
+ color : currentColor ;
144
114
}
145
- & :where([style *= " border-right-style" ]) {
146
- border-right-width : initial ;
147
- }
148
- & :where([style *= " border-bottom-style" ]) {
149
- border-bottom-width : initial ;
150
- }
151
- & :where([style *= " border-left-style" ]) {
152
- border-left-width : initial ;
115
+
116
+ :where(.wp-block-button.is-style-outline > .wp-block-button__link :not (.has-background )),
117
+ :where(.wp-block-button .wp-block-button__link.is-style-outline :not (.has-background )) {
118
+ background-color : transparent ;
119
+ // background-image is required to overwrite a gradient background
120
+ background-image : none ;
153
121
}
154
122
}
0 commit comments