Skip to content

Commit

Permalink
Override clearing of img borders in wp-admin by core
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronrobertshaw committed Jul 12, 2022
1 parent 4b7262e commit ae570a3
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions packages/block-library/src/image/style.scss
Expand Up @@ -97,6 +97,42 @@
border-radius: 0;
}
}

// The following is required to overcome WP Core applying styles that clear
// img borders with a higher specificity than those added by the border
// block support to provide a default border-style of solid when a border
// color or width has been set.
:where(.has-border-color) {
border-style: solid;
}
:where([style*="border-top-color"]) {
border-top-style: solid;
}
:where([style*="border-right-color"]) {
border-right-style: solid;
}
:where([style*="border-bottom-color"]) {
border-bottom-style: solid;
}
:where([style*="border-left-color"]) {
border-left-style: solid;
}

:where([style*="border-width"]) {
border-style: solid;
}
:where([style*="border-top-width"]) {
border-top-style: solid;
}
:where([style*="border-right-width"]) {
border-right-style: solid;
}
:where([style*="border-bottom-width"]) {
border-bottom-style: solid;
}
:where([style*="border-left-width"]) {
border-left-style: solid;
}
}

.wp-block-image figure {
Expand Down

0 comments on commit ae570a3

Please sign in to comment.