[英]What happened to the StyleRules property in ExCSS?
I have using: 我使用了:
var parser = new Parser();
var sheet = parser.Parse(css);
var query = from rule in sheet.StyleRules select rule;
I've upgraded to the latest version (v3.0.0) and changed the above to: 我已升级到最新版本(v3.0.0),并将以上内容更改为:
var parser = new StylesheetParser();
var sheet = parser.Parse(css);
var query = from rule in sheet.StyleRules select rule;
But the StyleRules
property doesn't exist anymore. 但是StyleRules
属性不再存在。 What's the new property called? 新的财产叫什么?
According to the readme.md
file on the ExCSS GitHub repository , it's now called Rules
. 根据ExCSS GitHub存储库上的readme.md
文件,现在将其称为Rules
。 Below is the code sample from that page (with a missing semicolon added by me): 以下是该页面的代码示例(我添加了一个缺少的分号):
var parser = new StylesheetParser(); var stylesheet = parser.Parse(".someClass{color: red; background-image: url('/images/logo.png')"); var rule = stylesheet.Rules.First(); var selector = rule.SelectorText; // Yields .someClass var color = rule.Style.Color; var image = rule.Style.BackgroundImage; // url('/images/logo.png')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.