Class Property
java.lang.Object
com.google.common.css.compiler.ast.Property
An object that represents a CSS property. Although this class contains a
large set of built-in properties (see
allRecognizedProperties()), it
is a class rather than an enum so that it is possible to create properties
that are not built-in. User agents will likely add support for new properties
faster than we can add them to this list.-
Method Details
-
byName
- Returns:
- a
Propertywith the specifiedname. Ifnamecorresponds to a recognized property, then the correspondingPropertywill be returned; otherwise, a newPropertywith the specifiednamewill be created.
-
getName
- Returns:
- the name of this CSS property as it appears in a stylesheet, such as "z-index"
-
isRecognizedProperty
public boolean isRecognizedProperty()- Returns:
- whether this Property is recognized by default by the CSS Compiler. Note that this is not the same as a being a "standard" CSS property because the CSS Compiler recognizes non-standard CSS properties such as "-webkit-border-radius", among others.
-
getShorthands
Returns the set of shorthand properties related to this property, or the empty set if this property is not standard.For example,
border-left-stylehasborder,border-leftandborder-styleas shorthands. -
getPartition
Gets the partition of this property. All properties with the same partition share a common shorthand. A non-standard property is its own single partition.For example,
padding,padding-bottom,padding-left,padding-right,padding-topare all in thepaddingpartition. As another example,z-indexis its own single partition.- Returns:
- a string representing the partition
-
isVendorSpecific
public boolean isVendorSpecific()- Returns:
- whether this Property is a vendor-specific CSS property, such as "-webkit-border-radius"
-
getVendor
- Returns:
- the corresponding
VendorifisVendorSpecific()returnstrue; otherwise, returnsnull
-
hasPositionalParameters
public boolean hasPositionalParameters()- Returns:
- whether this property can take positional parameters, such as "margin", where the parameters "1px 2px 3px" imply "1px 2px 3px 2px"
-
isCustom
public boolean isCustom()- Returns:
- whether this is a CSS custom property
-
isSvgOnly
public boolean isSvgOnly() -
hasWarning
public boolean hasWarning() -
getWarning
-
allRecognizedPropertyNames
- Returns:
- an immutable set of CSS properties recognized by default by the CSS Compiler
-
allRecognizedProperties
- Returns:
- an immutable set of
Propertyinstances recognized by default by the CSS Compiler
-