Thursday, September 22, 2022
HomeWeb DevelopmentCSS Guidelines vs. CSS Rulesets | CSS-Tips

CSS Guidelines vs. CSS Rulesets | CSS-Tips


The newest spec:

fashion rule is a certified rule that associates a selector listing with a listing of property declarations and presumably a listing of nested guidelines. They’re additionally referred to as rule units in CSS2.

Louis Lazaris:

Because the above quote from W3C signifies, it looks like the W3C considers “rule set” to be a little bit of an outdated time period, preferring the time period “fashion rule” (or presumably “rule” for brief).

I by no means observed that! “Rule set” is so gosh darned branded on my mind that it’s gonan take shedding numerous muscle reminiscence to start out utilizing “fashion rule” as an alternative. I didn’t see a particular observe within the spec’s Adjustments part, however you possibly can see the change within the desk of contents between variations:

Side-by-side screenshot comparing the table of contents for both the CSS 2 and CSS 3 specifications.

Louis properly sums up the elements of a mode rule as effectively:

/* The whole lot beneath is a mode rule (or rule set, or simply rule) */
part { /* The whole lot between the braces is a declaration block */
  margin: 0 20px; /* This line is a person declaration */
  colour: #888; /* One other declaration */
}

I do know nothing of the context and, at first, I used to be gonna poo-poo the change, however “fashion rule” actually is sensible the extra I sit with it. If the property:worth pairs are declarations that sit in a declaration block, then we’ve received one thing much less like a algorithm and extra like one rule that defines the kinds for a selector with a block of favor declarations. 👌

As soon as once more, naming issues is tough.


Direct Hyperlink →

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments