Sunday, May 5, 2024
HomeCSSCSS Guidelines vs. CSS Rulesets | CSS-Tips

CSS Guidelines vs. CSS Rulesets | CSS-Tips


The most recent spec:

model 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 known as rule units in CSS2.

Louis Lazaris:

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

I by no means seen that! “Rule set” is so gosh darned branded on my mind that it’s gonan take shedding quite a lot of muscle reminiscence to start out utilizing “model rule” as an alternative. I didn’t see a particular be aware within the spec’s Adjustments part, however you may 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 method rule as effectively:

/* Every thing under is a method rule (or rule set, or simply rule) */
part { /* Every thing 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 “model 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

Most Popular

Recent Comments