Differences Between CSS2.1 and CSS3+
Putting all cross-browser issues aside, I thought it would be nice to be able to document all these changes into a single post and keep it up to date.
So if you want a list of everything that’s been introduced into the CSS spec since CSS2.1, here it is.
New Properties
Following is a list of CSS properties that were not defined in the CSS2.1 specification.
animation(and eight associated longhand properties)background-clipbackground-originbackground-sizeborder-radius(and four associated longhand properties)border-image(and six associated longhand properties)box-decoration-breakbox-shadowbox-sizingcolumns(and thirteen associated multi-column properties)clear-afterflex(and eleven associated flexbox properties)font-stretchfont-size-adjustfont-synthesisfont-kerningfont-variant-capshanging-punctuationhyphensiconimage-resolutionimage-orientationline-breakobject-fitobject-positionopacityoutline-offsetoverflow-wrap/word-wrapbackface-visibilityperspectiveperspective-originpointer-events(for HTML)resizetab-sizetext-align-lasttext-decoration-linetext-decoration-skiptext-decoration-positiontext-decoration-styletext-emphasis(and three associated properties)text-justifytext-orientationtext-overflowtransformtransform-styletext-shadowtransition(and four associated longhand properties)word-breakword-spacingwriting-mode
New Values
Properties from CSS2.1 have new values added to them in CSS3. Following are those new values and which property each belongs to.
- Value “local” for the
background-attachmentproperty - Value "rgba()" for any property that accepts a color value
- Value "hsl()" for any property that accepts a color value
- Value "hsla()" for any property that accepts a color value
- Value "currentColor" for any property that accepts a color value
- Value "inset()" for the
clipproperty - Value "linear-gradient()" for any property that accepts an image value
- Value "radial-gradient()" for any property that accepts an image value
- Value "repeating-linear-gradient()" for any property that accepts an image value
- Value "repeating-radial-gradient()" for any property that accepts an image value
- Value "image()" for any property that accepts an image value
- Multiple comma-separated images for any property that accepts an image value
- Multiple comma-separated background-related values to match multiple background image declarations
- Value "center" for the
positionproperty - Value "page" for the
positionproperty - Value "space" for the
background-repeatproperty - Value "round" for the
background-repeatproperty - 15 new values for the
cursorproperty - Values "flex" and "inline-flex" for the
displayproperty - Values "all-small-caps", "petite-caps", "all-petite-caps", "titling-caps", and "unicase" for the
font-variantproperty - Multiple, space-separated values for the
letter-spacingproperty - New values for the
text-alignproperty, including "", "match-parent", "start", "end", and "start end" text-decorationis now a shorthand property- Keywords "hanging" and "each-line" declared along with length or percentage values for the
tfext-indentproperty - Value "full-width" for the
text-transformproperty remunits for lengthscalc()units for lengthstoggle()units- Angle units (
deg,grad,rad,turn) - Time units (
s,ms)
New Selectors
Following is a list of selectors introduced in CSS3.
- Substring matching attribute selectors (
[att^=val],[att$=val],[att*=val]) :targetpseudo-class- New pseudo-classes:
:enabled,:disabled,:checked, and:indeterminate :rootpseudo-class- New expression-based structural pseudo-classes:
:nth-child(),:nth-last-child(),:nth-of-type(),:nth-last-of-type() - Other new structural pseudo-classes:
:last-child,:first-of-type,:last-of-type,:only-child,:only-of-type,:empty - The negation pseudo-class
:not() - Four pseudo-elements with double-colon syntax (
::first-line,::first-letter,::before,::after) - The following-sibling combinator (
p ~ img) ::selectionpseudo-class (removed from the spec, but everyone uses it)
Other Miscallaneous New Features
Other new features not part of CSS2.1 include:
@font-face- Media Queries
- Keyframe animations using
@keyframes - Conditional styles using
@supports - Namespacing using
@namespace - Regions
- Filters
Features Still in Flux
The lists above aren't exhaustive. There's a lot that's still in major flux in the spec and that doesn't have much browser support. Below is a list of many of the new modules, which have loads of new features not mentioned above.
- Counter Styles Level 3
- Device Adaptation
- Display Module Level 3
- Line Grid
- Mobile Text Size Adjustment
- CSS Variables
- Box Alignment
- The "all" property
- Exclusions and Shapes
- Generated Content for Paged Media
- Grid Layout
- Grid Template Layout
- Line Layout Module
- New features in Lists and Counters
- Overflow Module
- New features in Paged Media
- New features in CSS Sizing
- Media Queries Level 4
- Selectors Level 4
- ch units
- Viewport relative lengths
- New resolution units
- Compositing and Blending
- New features in CSS speech
- The unicode-range descriptor for
@font-face - New features in CSS Images and Replaced Content
- CSS Masking
No comments:
Post a Comment