这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
6a71b53
WIP initial parse
jamesnw Jan 31, 2025
0b21169
Merge branch 'main' of https://github.com/oddbird/css-anchor-position…
jamesnw Jan 31, 2025
45341bf
Parse position area
jamesnw Feb 1, 2025
9a37226
Add position-area demo page, examples of known todos
jamesnw Feb 17, 2025
514f667
Include position-area.html in dist
jamesnw Feb 17, 2025
b396091
Allow for shared declarations with different co
jamesnw Feb 17, 2025
c5b9a9a
Types
jamesnw Feb 27, 2025
930b512
Position with grid wrapper
jamesnw Feb 28, 2025
b9905af
Fix example
jamesnw Mar 3, 2025
7b969de
Merge branch 'main' of https://github.com/oddbird/css-anchor-position…
jamesnw Mar 3, 2025
40c1c62
More example fixes
jamesnw Mar 3, 2025
dd1b399
Fix tests
jamesnw Mar 3, 2025
823bd28
Support inline styles
jamesnw Mar 3, 2025
d86f3d6
Links for examples
jamesnw Mar 3, 2025
706b640
Add link to position-area page
jamesnw Mar 3, 2025
c5190af
Merge branch 'main' into position-area
jgerigmeyer Mar 17, 2025
6ae5b47
Document safe keyword option
jamesnw Mar 24, 2025
22865f0
Clean up UUIDs, respect cascade
jamesnw Mar 27, 2025
65e6791
Simplify logic to not dupe wrpaper
jamesnw Mar 27, 2025
4688e2d
Move cascade example up
jamesnw Mar 27, 2025
67b85cb
Merge branch 'main' of https://github.com/oddbird/css-anchor-position…
jamesnw Mar 27, 2025
edbf927
Lint
jamesnw Mar 27, 2025
b4270fb
Allow multiple position-area declarations for a single selector
jgerigmeyer Mar 28, 2025
c1f630d
Test position area
jamesnw Mar 28, 2025
d7fc4ba
Merge branch 'position-area' into pa-review
jamesnw Mar 28, 2025
a6a107a
Merge pull request #302 from oddbird/pa-review
jamesnw Mar 28, 2025
85c8e4c
Make it clearer that the position area stylesheet is created
jamesnw Mar 31, 2025
a465619
Clean up and comments
jamesnw Mar 31, 2025
5ddf689
Docs
jamesnw Mar 31, 2025
a4d3ef4
Move toggle wrapper button
jamesnw Mar 31, 2025
b0d7030
Lint
jamesnw Mar 31, 2025
ae2a2f3
Fix label
jamesnw Apr 3, 2025
5b1d75e
Merge branch 'main' of https://github.com/oddbird/css-anchor-position…
jamesnw Apr 3, 2025
30bf400
Clean up types and start adding info for writing-mode
jamesnw Apr 3, 2025
e573b3c
Add support for writing mode
jamesnw Apr 4, 2025
3898b03
Add tests
jamesnw Apr 4, 2025
15080b9
Lint
jamesnw Apr 4, 2025
8c488fa
Move position area declarations from fallbacks file
jamesnw Apr 4, 2025
d4a547e
Update README
jamesnw Apr 4, 2025
01e5b7c
Cleanup
jamesnw Apr 7, 2025
ceac81c
Cleanup the cascaded properties
jamesnw Apr 7, 2025
dbf08df
revert dep change
jgerigmeyer Apr 7, 2025
60c9ba8
review
jgerigmeyer Apr 7, 2025
1ac8446
Revisions
jamesnw Apr 7, 2025
c726051
Merge branch 'main' of https://github.com/oddbird/css-anchor-position…
jamesnw Apr 7, 2025
7b4d8e6
Doc updates
jamesnw Apr 8, 2025
7be4f97
typo
jgerigmeyer Apr 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,18 +147,26 @@ following features:
- Polyfill allows anchoring in scroll more permissively than the spec allows,
for instance without a default `position-anchor`.
- `anchor-scope` property on pseudo-elements
- `position-area` property
- `anchor-center` value for `justify-self`, `align-self`, `justify-items`, and
`align-items` properties
- `position-visibility` property
- dynamically added/removed anchors or targets
- anchors or targets in the shadow-dom
- anchors or targets in constructed stylesheets (https://github.com/oddbird/css-anchor-positioning/issues/228)
- anchors or targets in constructed stylesheets
(https://github.com/oddbird/css-anchor-positioning/issues/228)
- anchor functions assigned to `inset-*` properties or `inset` shorthand
property
- vertical/rtl writing-modes (partial support)
- vertical/rtl writing-modes for anchor functions (partial support)
- implicit anchors or the `position-anchor: auto` keyword (pending resolution of
https://github.com/whatwg/html/pull/9144)
- `position-area` is polyfilled by adding a wrapping element around the target,
which adds a few differences:
- This breaks selectors that rely on a direct relationship with the target,
for instance `~ target`, `+ target`, `> target` or using `:nth` selectors.
- Overflow alignment is not applied for a target that overflows its
inset-modified containing block but would still fit within its original
containing block. In other words, a polyfilled target may be placed in a
`position-area` grid section outside its containing block, where the
implementation would move the target inside the containing block.

In addition, JS APIs like `CSSPositionTryRule` or `CSS.supports` will not be
polyfilled.
Expand Down
28 changes: 27 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
<link rel="stylesheet" href="/anchor-pseudo-element.css" />
<link rel="stylesheet" href="/anchor-media-query.css" />
<link rel="stylesheet" href="/anchor-scope.css" />
<link rel="stylesheet" href="/position-area.css" />
<link rel="stylesheet" href="/anchor-inside-outside.css" />
<!-- Included to test invalid stylesheets -->
<link rel="stylesheet" href="/fake.css" />
Expand Down Expand Up @@ -229,7 +230,7 @@
</head>
<body>
<header>
<h1>CSS Anchor Positioning Polyfill</h1>
<h1><a href="/">CSS Anchor Positioning Polyfill</a></h1>
<nav>
<span> See also: </span>
<a
Expand Down Expand Up @@ -965,6 +966,31 @@ <h2>

#other {
--center: anchor(--anchor-duplicate-custom-props 100%);
}</code></pre>
</section>
<section id="position-area" class="demo-item">
<h2>
<a href="#position-area" aria-hidden="true">🔗</a>
Positioning with <code>position-area</code>
</h2>
<div style="position: relative" class="demo-elements">
<div class="anchor">Anchor</div>
<div class="target">Target</div>
</div>
<p class="note">
With polyfill applied: Target is positioned to the top right of the
Anchor. See <a href="position-area.html">more examples</a> of
<code>position-area</code>.
</p>
<pre><code class="language-css"
>#position-area .anchor {
anchor-name: --position-area-anchor;
}

#position-area .target {
position: absolute;
position-area: top right;
position-anchor: --position-area-anchor;
}</code></pre>
</section>
<section id="anchor-size" class="demo-item">
Expand Down
1 change: 0 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading