-
Notifications
You must be signed in to change notification settings - Fork 21
Issue #3526953 by richardgaunt, fionamorrison23, iulianrotaru, joshua1234511: ct-align class overwriting align-center #1397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
WalkthroughA new SCSS partial for CKEditor-specific styles was introduced and imported into the main CivicTheme stylesheet. This update ensures that Changes
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
// These overrides will not be visible in the Storybook. | ||
@import 'page/page'; | ||
@import 'header/header'; | ||
@import 'ckeditor/ckeditor'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is specific to Drupal’s creditor classes, and therefore, it was more appropriate to handle it as a Drupal-specific override. Hence not added via UIKit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alan-cole This is best answered - will this cause issues if we have this included in the base Drupal CSS? From my mind no.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
web/themes/contrib/civictheme/assets/sass/ckeditor/ckeditor.scss (2)
2-3
: Correct the component name casing in header commentUse the canonical “CKEditor” spelling to stay consistent with upstream naming and the rest of the code base.
-// This file contains styles for the Ck Editor component in the CivicTheme. +// This file contains styles for the CKEditor component in CivicTheme.
6-6
: Remove the unused$root
variable
$root
is declared but never referenced. Leaving unused variables triggers Stylelintscss/no-unused-variable
and adds noise.- $root: &; + // $root placeholder removed – no references found
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
web/themes/contrib/civictheme/assets/sass/ckeditor/ckeditor.scss
(1 hunks)web/themes/contrib/civictheme/assets/sass/theme.scss
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Analyze (actions)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: commit
🔇 Additional comments (2)
web/themes/contrib/civictheme/assets/sass/ckeditor/ckeditor.scss (1)
8-16
: Adjust margin rules for centered images in CKEditorTo prevent fixed side margins from overriding Drupal’s default centering, split the combined rule so that only left/right use pixel offsets and center uses
auto
:// Keep spacing for left/right aligned figures. -&.align-left, -&.align-center, -&.align-right { +&.align-left, +&.align-right { display: block; margin-block-start: ct-particle(2); margin-block-end: ct-particle(2); margin-inline-start: ct-particle-px(5); margin-inline-end: ct-particle-px(5); } +// Preserve true horizontal centering for center-aligned figures. +&.align-center { + display: block; + margin-block-start: ct-particle(2); + margin-block-end: ct-particle(2); + margin-inline-start: auto; + margin-inline-end: auto; +}• Please test in CKEditor by inserting an image and using the Align center toolbar button—confirm it remains horizontally centered.
web/themes/contrib/civictheme/assets/sass/theme.scss (1)
10-10
: Import looks good – ensure partial exists in build path
@import 'ckeditor/ckeditor';
follows existing import style and will compile as long asassets/sass/ckeditor/_ckeditor.scss
(leading underscore) is present. No further action required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but Alan will have final review.
margin-block-start: ct-particle(2); | ||
margin-block-end: ct-particle(2); | ||
margin-inline-start: ct-particle-px(5); | ||
margin-inline-end: ct-particle-px(5); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand how these changes could fix the issue.
Can you provide screenshots showing how these changes fix the alignment issues mentioned in the ticket?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is quite working properly.
Looking at the screenshot, it looks like the "center" aligned image is really just left aligned, but sitting indented, and flush against the left aligned image.
If you look at the screenshot below, the center would be slightly different if it was sitting properly in the center:

https://www.drupal.org/project/civictheme/issues/3526953
Checklist before requesting a review
Issue #123456 by drupal_org_username: Issue title
Changed
section about WHY something was done if this was not a normal implementationChanged
Screenshots
Summary by CodeRabbit
New Features
Style