public IEnumerable<CssFunction> ExpandFor(Browser[] browsers) { foreach (var browser in browsers) { var args2 = new CssValueList(ValueSeperator.Comma); var i = 0; foreach (var arg in args) { // The legacy syntax didn't contain to on the direction if (i == 0 && arg.ToString().StartsWith("to ")) { args2.Add(CssValue.Parse(arg.ToString().Replace("to ", ""))); } else { args2.Add(arg); } i++; } var name = browser.Prefix.Text + "linear-gradient"; yield return new CssFunction(name, args2); } }
public bool NeedsExpansion(CssDeclaration declaration, Browser[] browsers) { if (browsers == null || browsers.Length == 0) return false; if (!Compatibility.HasPatches) return false; foreach (var browser in browsers) { if (Compatibility.HasPatch(declaration, browser)) return true; } return false; }
public static bool NeedsPatch(string value, Browser browser) { CssCompatibility c; if (table.TryGetValue(value, out c)) { if (c.IsPrefixed(browser)) { return true; } } return false; }
private void WriteKeyframesRule(Browser browser, KeyframesRule rule, int level) { browserSupport = new[] { browser }; writer.Write("@"); writer.Write(browser.Prefix.Text); writer.Write("keyframes "); writer.Write(rule.Name); writer.Write(" "); WriteBlock(rule, level); browserSupport = context.BrowserSupport; }