[wp-trac] [WordPress Trac] #52564: Twenty Twenty has unit-less CSS variable unfit for calc() (was: Twenty Twenty-One has unit-less CSS variable unfit for calc())
WordPress Trac
noreply at wordpress.org
Thu Feb 18 16:48:47 UTC 2021
#52564: Twenty Twenty has unit-less CSS variable unfit for calc()
---------------------------+---------------------
Reporter: nico23 | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 5.7
Component: Bundled Theme | Version:
Severity: normal | Resolution:
Keywords: | Focuses: css
---------------------------+---------------------
Changes (by nico23):
* keywords: needs-patch =>
Comment:
@joyously
I meant he 21 theme obviously.
I do not get what you are saying. Work best with no units? I showed the
opposite this BREAKS and not "works best". Then you follow up and say they
should be percentages? I do not get what you are saying.
As I said with this case the --global--admin-bar--height is like the
perfect example for a variable used to calc() positioning with (very
likely with addition). It literally BREAKS and has unexpected consequences
because you can not use it with in a unit calculation. Well not in
addition/substation to be perfectly correct as @ryelle just pointed out.
I copied it to my plugin anyway, but what do you think about just adding
this to core? I mean WP already puts out some `.admin-bar` CSS anyway when
you logged in. To not logged-in users the value could either be omitted
completely, so people can use their own 0px default or just include it
with `0px`
I do not understand why this CSS spec does this, its possible there is a
good reason but its pretty annoying to run into, especially when you work
with SCSS rules that actually say you should use unitless 0 instead of
0px, 0em ... So I have to put an ignore comment for the lines in or
globally allow the rules.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/52564#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list