예제 #1
0
        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);
            }
        }
예제 #2
0
파일: CssProperty.cs 프로젝트: carbon/Css
        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;
        }
예제 #3
0
파일: CssCursor.cs 프로젝트: carbon/Css
        public static bool NeedsPatch(string value, Browser browser)
        {
            CssCompatibility c;

            if (table.TryGetValue(value, out c))
            {
                if (c.IsPrefixed(browser))
                {
                    return true;
                }
            }

            return false;
        }
예제 #4
0
파일: CssWriter.cs 프로젝트: carbon/Css
        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;
        }