
Problem/Motivation
This is a child of #3324398: [META] Update Claro CSS with new coding standards and part of #3254529: [PLAN] Drupal CSS Modernization Initiative.
Steps to reproduce
The stylesheet at https://git.drupalcode.org/project/drupal/-/blob/10.0.x/core/themes/clar... needs to be refactored to make use of modern CSS and Drupal core's PostCSS tooling.
@todo: Add clear testing instructions to test this manually on the UI.
Proposed resolution
- Use CSS Logical Properties where appropriate.
- Use CSS nesting where appropriate.
- Use existing variables (
variables.pcss.css
) where appropriate. Follow the proposed Drupal CSS coding standards to name the variables. - Add a comment when there's a value where there is not a variable like
font-size: 1.23rem; /* @todo One off value. */
- When possible, set variables at the root of the component and then map them to global theme variables:
.entity-meta { --entity-meta-title-font-size: var(--font-size-h5); ... more style } .entity-meta__title { font-size: var(--entity-meta-title-font-size); }
Out of scope
- Changing CSS classes
- Drupal 9 patches
User interface changes
None. There should be no visual differences.
Please post before/after screenshots and make sure they look the same.
Comment | File | Size | Author |
---|---|---|---|
#27 | core-3332428-23.patch | 886 bytes | nod_ |
#20 | 3332428-20.patch | 2.3 KB | kostyashupenko |
#19 | 3332428-nr-bot.txt | 85 bytes | needs-review-queue-bot |
#18 | 3332428-18.patch | 2.41 KB | stanzin |
#13 | interdiff.txt | 1.6 KB | lauriii |
Issue fork drupal-3332428
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3332428-refactor-claros-page-title
changes, plain diff MR !3389
Comments
Comment #5
gauravvvv CreditAttribution: gauravvvv at Axelerant for Drupal India Association commentedImproved nesting of selectors. Please verify
Comment #6
smustgrave CreditAttribution: smustgrave at Mobomo commentedNot sure if
.region-header > .page-title {
But will let committer decide.
Comment #7
lauriiiUsing the
@nest
syntax would probably maker sense with the.region-header > .page-title
selector.Comment #8
gauravvvv CreditAttribution: gauravvvv at Axelerant for Drupal India Association commentedAddressed #7, attached patch and interdiff. please review
Comment #9
smustgrave CreditAttribution: smustgrave at Mobomo commentedThanks looks good now!
Comment #10
lauriiiThoughts on this? 😇
Comment #11
smustgrave CreditAttribution: smustgrave at Mobomo commentedLooks good code wise. Not aware of the @nest will have to look at that up.
Comment #12
bnjmnmI'm not a fan of the complied file resulting in the comment appearing in a different block than what it is commenting on. I know it's not in the file being edited but it could still be inspected in browser tools. If there isn't a way to tweak the syntax to get that working in this issue scope, perhaps there should be another issue to address comment placement in the built file and this can be postponed on that.
Comment #13
lauriiiIs there an inspector that shows CSS comments? 🤔 This should address the feedback but I'm not sure it's a good use of our time to optimize how comments appear in the generated CSS file.
Comment #15
gauravvvv CreditAttribution: gauravvvv at Axelerant for Drupal India Association commentedUnrelated failure. restoring status
Comment #18
stanzin CreditAttribution: stanzin as a volunteer commentedHow's this for D11?
Comment #19
needs-review-queue-bot CreditAttribution: needs-review-queue-bot as a volunteer commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #20
kostyashupenkoComment #21
smustgrave CreditAttribution: smustgrave at Mobomo commentedComment #22
quietone CreditAttribution: quietone at PreviousNext commentedI'm triaging RTBC issues. I read the IS and the comments. I didn't find any unanswered questions or other work to do.
Leaving at RTBC.
Comment #27
nod_Committed 59d11a9 and pushed to 11.x. Thanks!
The patch had an issue it was setting the top margin instead of the bottom margin. Fixed on commit, applied patch here.