-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
Support CSS custom properties (variables) #540
Comments
If this feature can be realized, it will be a powerful way to customize Vivliostyle themes. I'm looking forward to the addition of this feature:) |
I am also voting for this feature. CSS variables are a great way to reduce redundancy in CSS sheets. |
Now Vivliostyle.js (v2.17.0) supports CSS Custom Properties for Cascading Variables Module Level 1. CSS variables can be used within any style rules, also can be used in :root {
--page-width: 148mm;
--page-height: 210mm;
--page-margin: 20mm;
--page-header: "My Report";
--page-footer: counter(page) " / " counter(pages);
}
@page {
size: var(--page-width) var(--page-height);
margin: var(--page-margin);
@top-center {
content: var(--page-header);
}
@bottom-center {
content: var(--page-footer);
}
} |
Great! Are fallback values also supported, like in: var(--my-color, blue) |
Yes, the whole https://www.w3.org/TR/css-variables-1/ spec is supported. |
CSS Custom Properties for Cascading Variables Module Level 1
https://drafts.csswg.org/css-variables/
The text was updated successfully, but these errors were encountered: