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

CSS4 variables not working with functions #2516

Closed
rraziel opened this issue May 3, 2018 · 3 comments
Closed

CSS4 variables not working with functions #2516

rraziel opened this issue May 3, 2018 · 3 comments

Comments

@rraziel
Copy link

rraziel commented May 3, 2018

Hello,

Not sure whether this has been reported (or whether it's not supposed to work by design) but the following:

@function testfunc($x) {
    @return $x;
}

body {
    --test: testfunc(42);
    -test: testfunc(42);
    test: testfunc(42);
}

Turns into the following CSS:

body {
    --test: testfunc(42);
    -test: 42;
    test: 42;
}

Is there any reason why the CSS variable one does not work?

@rraziel
Copy link
Author

rraziel commented May 3, 2018

Hm nevermind just found this: sass/libsass#2621 and the following indeed works:

body {
    --test: #{testfunc(42)};
}

@rraziel rraziel closed this as completed May 3, 2018
@nex3
Copy link
Contributor

nex3 commented May 4, 2018

Check out this blog post if you're interested in learning why interpolation is required here.

@rraziel
Copy link
Author

rraziel commented May 5, 2018

Thanks, that makes a lot of sense (and I assume I won't be the last one to run into this).

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

No branches or pull requests

2 participants