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

Properties with value inherit omitted from serialized CSS #100

Closed
mganss opened this issue Jan 18, 2022 · 1 comment
Closed

Properties with value inherit omitted from serialized CSS #100

mganss opened this issue Jan 18, 2022 · 1 comment
Labels
Milestone

Comments

@mganss
Copy link
Contributor

mganss commented Jan 18, 2022

var html = @"<style>div { margin: 24px } #x div { margin: inherit }</style>";
var parser = new HtmlParser(new HtmlParserOptions(), BrowsingContext.New(Configuration.Default.WithCss(new CssParserOptions())));
var dom = parser.ParseDocument(html);
var styleSheet = dom.StyleSheets[0] as ICssStyleSheet;
var css = styleSheet.ToCss(); // -> "div { margin: 24px }\r\n#x div { }"

This seems to only occur if a shorthand is specified. If you specify margin-top: inherit for example it works.

@FlorianRappl
Copy link
Contributor

Landed in devel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants