-
Notifications
You must be signed in to change notification settings - Fork 61
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
Incorrect output and duplication when defining a variable relative to another #105
Comments
Try to set the global variables and then change them within the @MADIa
frame. Maybe this will solve your problem
==============
Best regards,
Willie S. Ceres
(@htmlstrap)
------------------------
[image: Picture]
…On Mon, Sep 2, 2019 at 9:25 PM ecc521 ***@***.***> wrote:
Inputting the code
@media screen and (min-width: 500px) {
:root {
--defaultFontSize: 2.8vw;
--specialFontSize: var(--defaultFontSize);
}
}
@media screen and (min-width: 600px) {
:root {
--defaultFontSize: 3.8vw;
}
}
body {
font-size: var(--specialFontSize)
}
outputs
body {
font-size: undefined
}
@media screen and (min-width: 600px) {
body {
font-size: undefined
}
}
@media screen and (min-width: 500px) {
body {
font-size: 2.8vw
}
}
@media screen and (min-width: 500px) {
body {
font-size: 2.8vw
}
}
Note the font-size:undefined in the second declaration. That should be a
3.8vw.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#105?email_source=notifications&email_token=AHFJSLDRHIH2I7PSQRT6PLDQHVLBXA5CNFSM4IS7RULKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HI2VYVQ>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHFJSLGT76DRDXUQMP2DLF3QHVLBXANCNFSM4IS7RULA>
.
|
That is actually what my site happened to do - the code in the bug report was just a short example. :root {
--defaultFontSize: 4vw;
--specialFontSize: 3vw;
}
@media screen and (min-width: 500px) {
:root {
--defaultFontSize: 2.8vw;
--specialFontSize: var(--defaultFontSize);
}
}
@media screen and (min-width: 600px) {
:root {
--defaultFontSize: 3.8vw;
}
}
body {
font-size: var(--specialFontSize)
} Yields body {
font-size: 3vw
}
@media screen and (min-width: 600px) {
body {
font-size: 3vw
}
}
@media screen and (min-width: 500px) {
body {
font-size: 2.8vw
}
}
@media screen and (min-width: 500px) {
body {
font-size: 2.8vw
}
} Notice how the output has a Additionally, there are two identical |
Inputting the code
outputs
Note the font-size:undefined in the second declaration. That should be a 3.8vw.
The text was updated successfully, but these errors were encountered: