Skip to content

Commit c464cf4

Browse files
committed
width and padding
1 parent d60e831 commit c464cf4

File tree

1 file changed

+18
-25
lines changed

1 file changed

+18
-25
lines changed

permission-element.bs

+18-25
Original file line numberDiff line numberDiff line change
@@ -817,31 +817,24 @@ permission {
817817
Additionally, some rules apply based on conditions not easily expressible as
818818
CSS.
819819

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.
820+
The limits on 'width' and 'padding-left' take multiple conditions into account.
821+
We distinguish between whether the element has an "obvious" border, and will
822+
place additional restrictions on it if not. The border is considered "obvious"
823+
if:
824+
825+
* 'border-bottom', 'border-top', 'border-left', and 'border-right' are all
826+
at least 1px,
827+
* 'border-color' is opaque,
828+
* the contrast ratio of 'border-color' and the element's 'color' is at least 3.
829+
830+
* If the border is "obvious" and 'width' is [=auto=],
831+
* then do nothing.
832+
* If the border is "obvious" and 'width' is not 'width/auto',
833+
* then set 'padding-left' to `0`.
834+
* If the border is not "obvious" and 'width' is [=auto=],
835+
* then set 'padding-left' to `clam(none, computed, 5em)`.
836+
* If the border is no "obvious" and 'width' is not [=auto=],
837+
* then set 'padding-left' to `0`.
845838

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

0 commit comments

Comments
 (0)