-
Notifications
You must be signed in to change notification settings - Fork 221
Fix font weight of cart totals title in site editor #12051
Conversation
The release ZIP for this PR is accessible via:
Script Dependencies ReportThere is no changed script dependency between this branch and trunk. This comment was automatically generated by the TypeScript Errors Report
🎉 🎉 This PR does not introduce new TS errors. |
Size Change: +65 B (0%) Total Size: 1.61 MB
ℹ️ View Unchanged
|
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.
Thanks for the PR, @nielslange – it looks great! 👍 I have just a small suggestion. Since the font-weight: bold;
for the th
element is determined by the browser's user agent, wouldn't it be safer for us to override this style ourselves? This could ensure consistency, particularly if different browsers apply varying font-weight
values.
Thanks for reaching out, @tarhi-saad. Can you clarify what you mean by "Since the |
@nielslange, the default styles of HTML elements (e.g., |
Thanks for clarifying this, @tarhi-saad. To be consistent with the other elements, I've applied |
The changes look good, @nielslange! Let's 🚢 it! |
9bdd5c6
to
f9910b5
Compare
What
Fixes #11870
Why
In #11870, @ralucaStan reported that when viewing the Cart block in the site editor, the title
Cart totals
is using a different font weight than the titlesProduct
andTotal
.The reason behind that is that the titles
Product
andTotal
are displayed in a<th>
element. By default, the<th>
element is usingfont-weight: bold
which translates tofont-weight: 700
, see https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight#syntax.The
Cart totals
title, however, is a<textarea>
to enable merchants to customise the text of this title. By default, the<textarea>
element is usingfont-weight: normal
which translates tofont-weight: 400
.In the initial report (#11870), the issue was observed in the Twenty Twenty-Four theme. Upon further investigation, I noticed that this issue not only affected the Twenty Twenty-Four theme, but all block themes, including Twenty Twenty-Three and Twenty Twenty-Two. This broader impact was due to the nature of the issue.
I also noticed that in the frontend, the title
Cart totals
was usingfont-weight: 600
. To ensure a consistent font weight, this PR changes the corresponding definition tofont-weight: 700
.Testing Instructions
Please consider any edge cases this change may have, and also other areas of the product this may impact.
/wp-admin/site-editor.php?path=%2Fpage
and open the Cart page.Product
,Total
andCart totals
are usingfont-weight: bold
resp.font-weight: 700
./wp-admin/site-editor.php?path=%2Fwp_template
.Screenshots or screencast
Site editor
Frontend
Cross-browser compatibility
WooCommerce Visibility
Checklist
Required:
[type]
label or a[skip-changelog]
label.Conditional:
[skip-changelog]
label is not present).Changelog