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 |
|---|---|---|---|
| #36 | views-ui-dialog-RTL-after.png | 170.97 KB | akshayadhav |
| #36 | views-ui-dialog-RTL-before.png | 183.37 KB | akshayadhav |
| #36 | views-ui-dialog-after.png | 175.8 KB | akshayadhav |
| #36 | views-ui-dialog-before.png | 182.3 KB | akshayadhav |
| #36 | views-ui-RTL-after.png | 341.32 KB | akshayadhav |
Issue fork drupal-3332743
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:
Comments
Comment #4
gauravvvv commentedImproved CSS nesting in the file. Attached patch for same.
Comment #5
gauravvvv commentedComment #6
djsagar commentedTried to fix CCF for #4.
Comment #8
bspeare commentedComment #9
gauravvvv commentedI have refactored the code, please review
Comment #10
smustgrave commentedThis could use more nesting. Lost of instances (too many to full note each) but example
.views-config-group-region .views-group-box--value > .form-item::before {
.views-config-group-region .views-group-box--value > .form-item::after {
Comment #11
gauravvvv commentedTried to improve nesting. attached interdiff for same
Comment #12
smustgrave commentedNesting seems much better.
Comment #15
stanzin commentedimprovised nesting :)
Comment #16
smustgrave commentedPlease provide an interdiff.
And since we have changes again will probably need another before/after screenshots.
Comment #17
akshayadhavWorking on this issue as a part of Claro Contribution Day.
Comment #18
akshayadhavMade required changes. Removed
@nestfrom the code as per guidelines mentioned here.Please find attached images for before and after of both LTR and RTL language patterns.
Comment #20
akshayadhavComment #22
finnsky commentedConverted #18 to MR
Comment #25
finnsky commentedGonna work on it a bit
Comment #26
finnsky commentedSwitching to another issue.
It still needs work at least in terms of source file formatting and variables usage.
Comment #27
akshayadhavLet me take a look into it again.
Comment #28
akshayadhavHi @finnsky
I have made the required changes for file formatting as well as tried to use variables wherever possible. Apart from properties where values are in decimals.
Also, I have kept the
padding-bottomproperty as it is as per the comment on top of it.Comment #29
smustgrave commentedWith latest changes thing we need new screenshots
Just one set
Comment #30
gauravvvv commentedUpdated some logical properties and removed duplicated selectors. Still needs screenshots.
Comment #31
akshayadhavHi @Gauravvvv
We should not include @nest. That's why I have removed it in my previous commit.
You can check this link for reference.
Comment #32
finnsky commentedNice catch @AkshayAdhav
Probably you can create issue to remove @nest usage?
Comment #33
akshayadhav@finnsky I think we should make
@nestrelated changes while refactoring only.But I guess most of us are missing this point, so we can create new issues if required.
Comment #34
finnsky commentedYep. I've checked. Sadly lot of that @nest were added in recent refactor tickets :)
Comment #35
akshayadhavDamn... Then we need to create child tickets for each refactor related issue tickets.
Comment #36
akshayadhav@smustgrave attaching the screenshots with the latest changes.
Comment #37
gauravvvv commentedWe discussed this some time back, please see Drupal slack Conversation also, an issue.
Comment #38
smustgrave commentedAlso as noted on a few tickets and in slack now. The @nest tickets should be consolidated into one.
Changes here seem fine thanks for the screenshots.
Comment #39
quietone commentedI'm triaging RTBC issues. I read the IS.
I then read the MR and found an @todo with a link to a closed issue. That is not a review as I don't do front end. I am setting this to needs work.
Comment #40
gauravvvv commentedAddressed feedback of #39. please review
Comment #41
smustgrave commentedNow it points to a closed issue.
Comment #42
gauravvvv commentedThe reference is correct; however, the earlier issue it pertains to is a duplicate of this closed issue. We can create a new issue to address that.
Comment #43
smustgrave commentedSo we are saying this will be revisited in a closed ticket? Therefore it’ll never actually be revisited.
So since the referenced issue is closed we may need to revisit it now in this ticket.
Comment #44
gauravvvv commentedhere I meant that we can create a new issue for this.
Yes we can do it. Moving to NW to revisit this.
Comment #46
quietone commentedThe Claro theme was approved for removal in #3576460: [policy, no patch] Deprecate and remove Claro.
This is Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.
The deprecation work is in #3576668: [meta] Tasks to deprecate Claro and the removal work in #3584638: [meta] Tasks to remove the Claro theme.