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

Fix undefined variables issue #16

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

allancole
Copy link

@allancole allancole commented May 10, 2020

  • Add --preserve-variables option to allow CSS-variables to appear in output.
  • Update --minify option to make minification work again.
  • Fix :root selector typo.
  • Recompile the CSS with all the CSS-variables intact :-)

Fixes: #14

Allan Cole added 3 commits May 9, 2020 20:44
- Add `--preserve-variables` option to allow CSS-variables to appear in output.
- Update `--minify` option to make minification work again.
@jalcine
Copy link

jalcine commented Jun 15, 2020

gently bumps this PR

@jalcine
Copy link

jalcine commented Jul 11, 2020

I’ve had to downgrade my library in order to keep things working. Is there any interest in merging these changes to keep this library working?

(Originally published at: https://v2.jacky.wtf/post/002b6721-da8f-4a04-a904-fd376e10ce3e)

@orionrush
Copy link

orionrush commented Jul 11, 2020 via email

@allancole
Copy link
Author

@mrmrs / @johno, do either of you have a second to review and merge this small but necessary PR :-)

@bradobro
Copy link

@allancole thanks for the fix, really helped me out.

I'm cool with this patch, but noticed that correcting _variables.css (root: should be :root) is the only fix needed to restore former behavior.

The --preserve-variables is great for new browsers. Thanks for highlighting that. I'd like to see package.json stay as you propose here, but maybe add a script, npm legacy:css to hard code custom props.

Thanks again for the fix!

@Spittal
Copy link

Spittal commented Sep 15, 2020

I kind of think that the Tachyons team doesn't care about this repository. But there's a lot of variables that are used in source that are not defined in the variables.css for example:

    --border-width-none: 0;
    --border-width-1: 0.2rem;
    --border-width-2: 0.4rem;
    --border-width-3: 0.8rem;
    --border-width-4: 1.6rem;
    --border-width-5: 3.2rem;

    --black: #000;
    --near-black: #111;
    --dark-gray: #333;
    --mid-gray: #555;
    --gray: #777;
    --silver: #999;
    --light-silver: #aaa;
    --moon-gray: #ccc;
    --light-gray: #eee;
    --near-white: #f4f4f4;
    --white: #fff;
    --transparent: transparent;
    --black-90: rgba(0,0,0,.9);
    --black-80: rgba(0,0,0,.8);
    --black-70: rgba(0,0,0,.7);
    --black-60: rgba(0,0,0,.6);
    --black-50: rgba(0,0,0,.5);
    --black-40: rgba(0,0,0,.4);
    --black-30: rgba(0,0,0,.3);
    --black-20: rgba(0,0,0,.2);
    --black-10: rgba(0,0,0,.1);
    --black-05: rgba(0,0,0,.05);
    --black-025: rgba(0,0,0,.025);
    --black-0125: rgba(0,0,0,.0125);
    --white-90: rgba(255,255,255,.9);
    --white-80: rgba(255,255,255,.8);
    --white-70: rgba(255,255,255,.7);
    --white-60: rgba(255,255,255,.6);
    --white-50: rgba(255,255,255,.5);
    --white-40: rgba(255,255,255,.4);
    --white-30: rgba(255,255,255,.3);
    --white-20: rgba(255,255,255,.2);
    --white-10: rgba(255,255,255,.1);
    --white-05: rgba(255,255,255,.05);
    --white-025: rgba(255,255,255,.025);
    --white-0125: rgba(255,255,255,.0125);

As of 4.9.8 all of these variables are being referenced in source, but aren't in the variables file. It might be worth adding them back in.

@bradobro
Copy link

bradobro commented Sep 16, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Version 4.9.8 is broken
5 participants