Skip to content

Commit

Permalink
[css-backgrounds-4] Incorporate logical keywords to background-position
Browse files Browse the repository at this point in the history
  • Loading branch information
fantasai committed Sep 13, 2024
1 parent 503c6ce commit 46e0719
Showing 1 changed file with 38 additions and 39 deletions.
77 changes: 38 additions & 39 deletions css-backgrounds-4/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -205,49 +205,48 @@ Tiling Images Shorthand: the 'background-repeat' property</h3>
<h3 id="the-background-position">
Background Positioning: the 'background-position' shorthand property</h3>

<pre class="propdef shorthand">
Name: background-position
Value: <<bg-position>>#
<pre class="propdef">
Name: background-position
Value: <<bg-position>>#
Initial: 0% 0%
Applies to: all elements
Inherited: no
Percentages: refer to size of <span class=index>background positioning area</span>
<em>minus</em> size of background image; see text
Computed value: a list,
each item a pair of offsets (horizontal and vertical) from the top left origin,
each offset given as a computed <<length-percentage>> value
Animation type: repeatable list
</pre>

See [[CSS3BG]] for definition.

<p>Where
<pre class=prod><dfn>&lt;bg-position&gt;</dfn> = [
[ left | center | right | top | bottom | start | end | <<length-percentage>> ]
|
[ left | center | right | x-start | x-end | <<length-percentage>> ]
[ top | center | bottom | y-start | y-end | <<length-percentage>> ]
|
[ center | [ left | right | x-start | x-end ] <<length-percentage>>? ] &amp;&amp;
[ center | [ top | bottom | y-start | y-end ] <<length-percentage>>? ]
|
[ center | [ start | end ] <<length-percentage>>? ]
[ center | [ start | end ] <<length-percentage>>? ] ]</pre>

Values have the following meanings:
<dl>
<dt>One value
<dd>
If only one value is given,
and that value is ''background-position/start'' or ''background-position/end'',
then the keyword is duplicated;
otherwise the second keyword defaults to ''background-position/center''.
The resulting value is treated as a two-component value.
If [=background images=] have been specified,
this property specifies their initial position
(after any <a href="#background-size">resizing</a>)
within their corresponding [=background positioning area=].

<dt>More than one value
<dd>
If the value contains a ''background-position/start'' or ''background-position/end'' keyword,
then the shorthand sets
'background-position-inline' and 'background-position-block' to the specified values.
Otherwise
the shorthand sets
'background-position-x' and 'background-position-y' to the specified values.

Issue: Specify the value assignment in more detail. Should expand just like Level 3.
</dl>
This property is a [=shorthand property=] that sets
'background-position-x', 'background-position-y', 'background-position-block', and 'background-position-inine'
in a single declaration.

Its value is given as a comma-separated list
of <dfn><<bg-position>></dfn> values, which are interpreted as <<position>> values
with the resized [=background image=] as the [=alignment subject=]
and the [=background positioning area=] as the [=alignment container=].

<pre class=prod>
<<bg-position>> = <<position>> | <<position-three>>
<position-three> = [
[ left | center | right ] && [ [ top | bottom ] <<length-percentage>> ]
|
[ [ left | right ] <<length-percentage>> ] && [ top | center | bottom ]
]
</pre>

The omitted <<length-percentage>> in the 'background-position'-specific
<<position-three>> syntax variant
defaults to ''0%''.

Issue: Specify what happens to set of properties that are not set. Maybe they're just not set?
Issue(9690): Specify how the [=longhand properties=] are set.

<h4 id="background-position-longhands">
Background Positioning Longhands: the 'background-position-x', 'background-position-y', 'background-position-inline', and 'background-position-block' properties</h4>
Expand Down

0 comments on commit 46e0719

Please sign in to comment.