C# Class MoreInternals.Compiler.Tasks.AutoPrefix

For every property that has a vendor prefix equivalent, generate that equivalent. Informs if we encounter a prefixed property we could generate, ignores those we aren't aware of. While the order of rules that aren't getting prefixed doesn't matter, the this task guarantees that rules which are prefixed appear before their equivalent unprefixed version. This is important for future proofing, as initial browser implementation vagaries shouldn't override the final (hopefully) compliant implementation.
Show file Open project: kevin-montrose/More

Public Methods

Method Description
Task ( List blocks ) : List

Private Methods

Method Description
IEOpacity ( Prefix pre, NameValueProperty opacity ) : IEnumerable

Old versions of IE have two different syntax's for opacity: - -ms-filter: progid:DXImageOhKillMeNow(Opacity=percent) - filter: alpha(opacity=percent)

MozBackgroundBoxAlt ( Prefix pre, NameValueProperty backgroundX ) : IEnumerable

Mozilla supports prefixed versions of background-clip & background-origin that accepts alternate versions of padding-box and border-box; padding and border respectively.

PrefixBlock ( SelectorAndBlock block ) : SelectorAndBlock
PrefixBox ( Prefix pre, NameValueProperty display ) : IEnumerable

For the display: box; property, changes the value to display: -prefix-box;

PrefixProperty ( NameValueProperty prop ) : List
Rename ( string newName ) : Prefixer

Handles a straight up name change. If a browser implements a property as "-pre-foo" but the spec comes down to "bar", this let's use build a Prefixer that will map "bar: x' to "-pre-foo: x"

WebkitBackgroundBoxAlt ( Prefix pre, NameValueProperty backgroundX ) : IEnumerable

Webkit supports prefixed versions of background-clip & background-origin that accepts alternate versions of padding-box, border-box, and content-box; padding, border, and content respectively.

WebkitBackgroundSize ( Prefix pre, NameValueProperty backgroundSize ) : IEnumerable

Webkit's prefixed background-size differs from the spec in that a single value (background-size: X) is treated like (background-size: X X). It should be treated as (background-size: X auto), this detects and inserts that case. In the case where two values are passed, the prefixed version matches the final spec.

WebkitBorderRadius ( Prefix pre, NameValueProperty borderRadius ) : IEnumerable

border-radius and -moz-border-radius differ. -webkit-border-radius: a b; is equivalent to -webkit-top-left-border-radius: a b; -webkit-top-right-border-radius: a b; etc. border-radius: a b; is equivalent to border-top-left-radius: a; border-top-right-radius: b; border-bottom-right-radius: a; border-bottom-left-radius: b; This is only true if border-radius has two values; for all other configurations they are equivalent (at least so far as I can tell).

Method Details

Task() public static method

public static Task ( List blocks ) : List
blocks List
return List