Skip to content
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

Increase CSS specificity of text alignment classes #62260

Open
wants to merge 3 commits into
base: trunk
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions packages/block-library/src/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,17 @@
}

// Text alignments.
.has-text-align-center {
// Increase specificity so that styles applied via the global styles can be overridden in block instances.
:root .has-text-align-center {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we not need the same for .has-larger-font-size etc. above?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, it sounds to me like these types of selectors should move after theme.json styles. These are not default styles to me.

text-align: center;
}

.has-text-align-left {
:root .has-text-align-left {
/*rtl:ignore*/
text-align: left;
}

.has-text-align-right {
:root .has-text-align-right {
/*rtl:ignore*/
text-align: right;
}
Expand Down
Loading