[wp-meta] [Making WordPress.org] #6982: Need example about inline CSS Coding Standards
Making WordPress.org
noreply at wordpress.org
Thu May 11 21:56:48 UTC 2023
#6982: Need example about inline CSS Coding Standards
---------------------------+---------------------
Reporter: monzuralam | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone:
Component: Developer Hub | Resolution:
Keywords: |
---------------------------+---------------------
Comment (by jrf):
@monzuralam Thanks for bringing it up and thanks @milana_cap for looping
me in.
I'm not sure that I understand correctly what you mean by "inline CSS" and
agree with Milana that in principle there is no difference coding
standards wise with "inline" (as in "embedded in a PHP file") or "in file"
(as in "in a separate CSS file") CSS.
When I look at the above examples, I think you are talking about something
else though.
I see two CSS examples with selectors which use higher specificity than
the code samples in the existing docs and I agree that it might be good to
add one or two higher specificity examples to the docs.
Having said that, both the above examples would in my opinion be
invalid/incorrect for the current coding standards for the following
reasons:
* Higher specificity is still just a single selector.
* Spacing around the open brace is incorrect (as Milana also pointed out).
So, based on my reading of the current standards, the correct example
should be like this:
{{{
#correct .selector-1 {
color: green;
}
}}}
On a practical note, the coding standards docs have their own repo and PRs
can be submitted there if this would be something to patch:
https://github.com/WordPress/wpcs-docs
--
Ticket URL: <https://meta.trac.wordpress.org/ticket/6982#comment:3>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org
More information about the wp-meta
mailing list