Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix html invalid attribute #88

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ That's why I have decided to stop working on this project.
- `style.getPropertyValue('--x')`
- `getComputedStyle(el).getPropertyValue('--inherited')`
- Houdini’s new API: `CSS.registerProperty({name:'--red', inherit:false, initialValue:'#e33'})` (of course not animatable)
- style-attributes `<div ie-style="--foo:bar"...`
- style-attributes `<div data-ie-style="--foo:bar"...`
- cascade works
- inheritance works
- `!important` on setters and getters (see limitations)
Expand Down Expand Up @@ -86,7 +86,7 @@ li.iecp-u4 { color:green; }
## Limitations
#### Styles in element-attributes
There is no way to get the raw content of style-attributes in IE11.
Use `<div style="--color:blue" ie-style="--color:blue">` for this.
Use `<div style="--color:blue" data-ie-style="--color:blue">` for this.

#### Specificity for properties containing "var()"
...is ~~always little~~ higher if vars are not served by root, because each selector gets an additional class-selector
Expand Down
4 changes: 2 additions & 2 deletions ie11CustomProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@



onElement('[ie-style]', function (el) {
var newCss = rewriteCss('{'+el.getAttribute('ie-style')).substr(1);
onElement('[data-ie-style]', function (el) {
var newCss = rewriteCss('{'+el.getAttribute('data-ie-style')).substr(1);
el.style.cssText += ';'+ newCss;
var found = parseRewrittenStyle(el.style);
if (found.getters) addGetterElement(el, found.getters, '%styleAttr');
Expand Down