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

When '!important' used in declaration output is incorrect #10

Open
digisavvy opened this issue Jan 22, 2015 · 11 comments
Open

When '!important' used in declaration output is incorrect #10

digisavvy opened this issue Jan 22, 2015 · 11 comments

Comments

@digisavvy
Copy link

Hey there,
I'm using !important in some of my declarations. I notice that the output is incorrect in one of the sass files.

For example,
.selector{
@include float(left !important)
}

Will output to the following in the ltr and rtl files
.selector {
float: left !important;
}

The direction doesn't change in the RTL file

@anasnakawa
Copy link
Owner

might be late to answer,
yes !important is not supported here,

however you can use the ltr & rtl mixins for any special case

@include ltr {
  padding-left: 10px !important;
}

@include rtl {
  padding-right: 10px !important;
}

@zeroxme
Copy link
Contributor

zeroxme commented Mar 29, 2015

There's a better way if you can add !important as optional argument to the mixin

@anasnakawa
Copy link
Owner

pull requests are welcome, but should not break previous behavior ( backward compitable )

@zeroxme
Copy link
Contributor

zeroxme commented Mar 29, 2015

I managed to do it but not backward compatible :( ... I'll try and if i did it i'll make a pull request for sure

@anasnakawa
Copy link
Owner

@izer0x here's a quick proof of concept of how to implement the !important feature, while making your changes backward compatible.

http://sassmeister.com/gist/8711ff25a2cf5e0a2ffd

@zeroxme
Copy link
Contributor

zeroxme commented Apr 1, 2015

@anasnakawa looking good! but I remember that I did it in the same way and it threw an error. Anyway i'll look again and see how it plays :)

zeroxme added a commit to zeroxme/bi-app-sass that referenced this issue Apr 2, 2015
anasnakawa added a commit that referenced this issue Apr 9, 2015
add !important support to float mixin #10, thanks @izer0x !
@gigermocas
Copy link

#11 adds an extra space to the float mixin's output if you don't actually use !important (eg: "float: left ;")

@anasnakawa
Copy link
Owner

I think we need to have a better approach than quoting / unquoting $important variable,
the best approach I can think of is the same one I have recently suggested..

http://sassmeister.com/gist/8711ff25a2cf5e0a2ffd

@gigermocas
Copy link

Sure, although I find the extra boolean argument a bit funky, it makes the file a bit less readable, personally I would prefer to keep the "!important", don't know if that's possible though...

@anasnakawa
Copy link
Owner

but that extra boolean argument is optional, isn't it ?

@gigermocas
Copy link

Yes, but you need it if you want to use the important directive: "@include float(left, true)" vs something like "@include float(left, !important)" or "@include float(left !important)". This is just a nitpick, mind you.

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

4 participants