Problem/Motivation
This is part of the CSS modernization initiative.
Steps to reproduce
The stylesheet at https://git.drupalcode.org/project/drupal/-/blob/10.0.x/core/themes/claro/css/components/details.pcss.css needs to be refactored to make use of modern CSS and Drupal core's PostCSS tooling.
Proposed resolution
Use CSS Logical Properties where appropriate
Use CSS nesting where appropriate
Remaining tasks
We need two patches. One for Drupal 9.5.x and one for Drupal 10.0.x
We need a followup issue to refactor this component in Drupal 10.0.x to make use of component-level CSS custom properties and remove IE specific style definitions.
User interface changes
None. There should be no visual differences.
| Comment | File | Size | Author |
|---|---|---|---|
| #29 | 303544-29.patch | 16.54 KB | santosh_verma |
| #29 | interdiff_24-29.txt | 1.99 KB | santosh_verma |
| #29 | After.png | 205.87 KB | santosh_verma |
| #29 | Before.png | 222.9 KB | santosh_verma |
| #24 | interdiff-12_24.txt | 5.22 KB | gauravvvv |
Issue fork drupal-3303544
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:
- 3303544-refactor-claros-details
changes, plain diff MR !5567
Comments
Comment #2
aditya4478 commentedComment #3
aditya4478 commentedComment #4
sasanikolic commentedLet's not change the RTL classes. This also doesn't compile correctly.
These comment sections here are weird.
This should be the other way around, the first-child selector should be on the .claro-details--accordion-item with the .claro-details__summary--accordion-item nested.
Comment #5
sakthivel m commented#5 Please review the patch
Comment #6
ckrinaComment #7
ckrinaComment #8
ckrinaComment #9
smustgrave commentedPer our slack conversation a few weeks ago @ckrina moving these to postponed for I believe a followup on the game plan
Comment #10
stanzin commentedThis is my first Patch. Just checking for encoding errors.
Comment #11
smustgrave commentedYou can check for build errors by running
./core/scripts/dev/commit-code-check.shbefore uploading a patch to make sure there are no issues with code formatting. see https://www.drupal.org/docs/develop/development-tools/running-core-devel...Also would check how other tickets were done for this as far as updating with logical properties and nesting.
Comment #12
gauravvvv commentedI have updated the file with the CSS logical properties. I have attached a patch for same. please review
Comment #13
aditya4478 commentedLGTM !
Comment #15
gauravvvv commentedUnrelated failure, restoring status.
Comment #17
stanzin commentedPatch for V11
Comment #19
aditya4478 commented#17 shows unrelated JS failure.
#12 Patch is working for D11. LGTM !
Restoring Status, ready to be merged.
Comment #21
gauravvvv commentedPatch #12, is still passing all the tests. Restoring status, random failure
@Stanzin, Please add interdiff for #17
Comment #22
lauriiiThis style should be added back
Comment #23
_utsavsharma commentedTried to address 1 mentioned in #22.
Comment #24
gauravvvv commentedAddressed feedback #2, from #22 and feedback #1, from #22, is already addressed in patch #12. I have mentioned in comment #21 that patch #17 is not needed, patch #12 still applies cleanly. I have attached interdiff with #12, for moving detail variables from variable.pcss.css to details.pcss.css
Comment #26
gauravvvv commentedComment #27
smustgrave commentedIndent for new variables in details.pcss.css is off.
Also with the additional changes could use a new set of before/after screenshots
Thanks.
Comment #28
santosh_verma commentedworking on it
Comment #29
santosh_verma commentedIn this Patch addressing the comment #27,
attaching interdiff file.
Testing stepps
1.Install drupal 11.x.
2.navigate to
/admin/structure/types/addBefore


After
Comment #30
smustgrave commentedComment #32
smustgrave commentedAppears to be random
Comment #33
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue.
While you are making the above changes, we recommend that you convert this patch to a merge request. Merge requests are preferred over patches. Be sure to hide the old patch files as well. (Converting an issue to a merge request without other contributions to the issue will not receive credit.)
Comment #36
vsujeetkumar commentedConvert Patch #29 into MR. According to #33. Please have a look.
Comment #37
nitin shrivastava commented@vsujeetkumar MR#36 looks fine and applied successfully. Just a simple reroll into MR Moving this to RTBC.
Thanks !
Comment #38
nitin shrivastava commentedComment #39
nitin shrivastava commentedComment #40
finnsky commentedGonna check nightwatch failure
Comment #41
finnsky commentedNightwatch issue is gone after rebase. It was something random.
I reverted variables back to variables file. Because at least half of them used in few files. And removed one which not used anywhere.
Added few minor improvements.
Please review.
Comment #42
smustgrave commentedGotta love night watch haha
Comment #44
ckrinaCommitted d8e3d8c and pushed to 11.x. Thanks!