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

Documentation for .sass implementations #6

Closed
bmcminn opened this issue Feb 12, 2018 · 3 comments
Closed

Documentation for .sass implementations #6

bmcminn opened this issue Feb 12, 2018 · 3 comments

Comments

@bmcminn
Copy link

bmcminn commented Feb 12, 2018

Been dealing with SASS and it's lack of support for :root and came across this awesome library; So far I'm really digging it, but ran into a few other intrinsic limitations with the .sass syntax...

Namely: sass/sass#1088

Through that thread I found a user comment (sass/sass#1088 (comment)) which mentioned the map-merge method which solves this issue nicely.

@import "[%PATH%]/css-vars/css-vars";

$rootvars: ()

$rootvars: map-merge($rootvars, ( '--sidebar-width': $sidebar-width ))
$rootvars: map-merge($rootvars, ( '--topnav-height': $topnav-height ))
$rootvars: map-merge($rootvars, ( '-moz-tab-size': 4 ))
$rootvars: map-merge($rootvars, ( 'tab-size': 4 ))

@include css-vars($rootvars)

This yields the cleanest way to manage the syntax for .sass files and thought this might help other people in a similar situation.

@shospodarets
Copy link
Owner

map-merge functionality is used in css-vars themselves:
https://github.com/malyw/css-vars/blob/master/css-vars.scss#L32

You can even put additional vars to the global map used in the library:
map-merge($css-vars, ( '--sidebar-width': $sidebar-width )) ,
so you can avoid @include css-vars($rootvars).

Did you suggest to update the documentation (feel free to provide a PR in that case)
or you wanted to reference something else?

@bmcminn
Copy link
Author

bmcminn commented Feb 21, 2018

Mostly just documenting a workaround for peeps using .SASS syntax where multi-line map definitions are not allowed.

I'll look into a PR for the docs at some point, but for now this issue may help point people in the right direction.

@shospodarets
Copy link
Owner

Closing as inactive. @bmcminn feel free to reopen if you still have the use case and details

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