Skip to content

Commit d5d6181

Browse files
committed
width and padding
1 parent d1a9d8e commit d5d6181

File tree

1 file changed

+19
-25
lines changed

1 file changed

+19
-25
lines changed

permission-element.bs

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ spec:css2; type:property; text:padding-bottom
3737
spec:css2; type:property; text:padding-top
3838
spec:css2; type:property; text:padding-left
3939
spec:css2; type:property; text:padding-right
40+
spec:css-borders-4; type:property; text:border-color
4041
spec:css-borders-4; type:property; text:border-right
4142
spec:css-borders-4; type:property; text:border-left
4243
spec:css-borders-4; type:property; text:border-top
@@ -817,31 +818,24 @@ permission {
817818
Additionally, some rules apply based on conditions not easily expressible as
818819
CSS.
819820

820-
If 'height' is `auto`, then apply:
821-
822-
<pre class="highlight lang-css">
823-
@namespace "http://www.w3.org/1999/xhtml";
824-
permission {
825-
padding-top: clamp(1em, computed, none);
826-
padding-bottom: calc(padding-top);
827-
}
828-
</pre>
829-
830-
If 'width' is `auto`, then apply:
831-
832-
<pre class="highlight lang-css">
833-
@namespace "http://www.w3.org/1999/xhtml";
834-
permission {
835-
padding-left: clamp(none, computed, 5em);
836-
padding-right: calc(padding-left);
837-
}
838-
</pre>
839-
840-
Apply the following sheet, if the element does not have all of the following:
841-
842-
- A border width of at least `1px`,
843-
- a color to background-color contrast ratio of at least 3,
844-
- and alpha of 1.
821+
The limits on 'width' and 'padding-left' take multiple conditions into account.
822+
We distinguish between whether the element has an "obvious" border, and will
823+
place additional restrictions on it if not. The border is considered "obvious"
824+
if:
825+
826+
* 'border-bottom', 'border-top', 'border-left', and 'border-right' are all
827+
at least 1px,
828+
* 'border-color' is opaque,
829+
* the contrast ratio of 'border-color' and the element's 'color' is at least 3.
830+
831+
* If the border is "obvious" and 'width' is [=auto=],
832+
* then do nothing.
833+
* If the border is "obvious" and 'width' is not 'width/auto',
834+
* then set 'padding-left' to `0`.
835+
* If the border is not "obvious" and 'width' is [=auto=],
836+
* then set 'padding-left' to `clam(none, computed, 5em)`.
837+
* If the border is no "obvious" and 'width' is not [=auto=],
838+
* then set 'padding-left' to `0`.
845839

846840
<pre class="highlight lang-css">
847841
@namespace "http://www.w3.org/1999/xhtml";

0 commit comments

Comments
 (0)