Repository navigation
Commit b7963e4
committed
Common CSS: avoid false-positive border-style on custom properties
The attribute selectors [style*="border-width"] and
[style*="border-color"] match any inline style containing those
substrings — including CSS custom properties like
--my-border-width or --fir-list-border-color. This forces
border-style: solid on elements that have no actual border set.
Replace each [style*="prop"] with a group of three selectors:
[style^="prop"] — prop is the first declaration
[style*=";prop"] — prop follows a semicolon (no space)
[style*="; prop"] — prop follows a semicolon and space
Custom property names always start with --, so they can never
appear right after a semicolon or at the start of the style
string without the -- prefix. Real border declarations can.
Fixes WordPress#70211.1 parent 9408691 commit b7963e4
1 file changed
Lines changed: 64 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
129 | 137 | | |
130 | 138 | | |
131 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
132 | 145 | | |
133 | 146 | | |
134 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
135 | 153 | | |
136 | 154 | | |
137 | 155 | | |
138 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
139 | 162 | | |
140 | 163 | | |
141 | | - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
142 | 170 | | |
143 | 171 | | |
144 | 172 | | |
145 | 173 | | |
146 | | - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
147 | 180 | | |
148 | 181 | | |
149 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
150 | 188 | | |
151 | 189 | | |
152 | | - | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
153 | 196 | | |
154 | 197 | | |
155 | 198 | | |
156 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
157 | 205 | | |
158 | 206 | | |
159 | | - | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
160 | 213 | | |
161 | 214 | | |
162 | 215 | | |
| |||
187 | 240 | | |
188 | 241 | | |
189 | 242 | | |
190 | | - | |
| 243 | + | |
191 | 244 | | |
192 | 245 | | |
193 | 246 | | |
| |||
0 commit comments