Skip to content

Commit 7f7006d

Browse files
authored
Merge pull request #290 from oddbird/inline-styles
Document inline style limitation
2 parents 90e449c + 514d658 commit 7f7006d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

+16
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,22 @@ following features:
165165
In addition, JS APIs like `CSSPositionTryRule` or `CSS.supports` will not be
166166
polyfilled.
167167

168+
### Inline styles
169+
170+
Browsers provide some validation for imperatively setting inline styles.
171+
`el.style.color = "foo"` and `el.style.foo = "bar"` do not change the inline
172+
styles of `el`. This is problematic for this polyfill, as we would like to
173+
support `el.style.anchorName = "--foo"`, but that won't work in browsers that
174+
don't support the `anchor-name` property.
175+
176+
While `el.setAttribute('style', 'anchor-name: --foo')` or `<div
177+
style="anchor-name: --foo" />` both work, developers are often using tools that
178+
generate the DOM. Both React and Vue use methods that remove the unknown inline
179+
style properties at runtime.
180+
181+
If you are using inline styles to set anchor-related properties and the polyfill
182+
isn't working, verify that the inline styles are actually showing up in the DOM.
183+
168184
## Sponsor OddBird's OSS Work
169185

170186
At OddBird, we love contributing to the languages & tools developers rely on.

0 commit comments

Comments
 (0)