-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Placeholders #4134
Placeholders #4134
Conversation
+1 |
Moving this pull request to a later milestone - we can't use @extend in any real capacity at the moment due to libsass support. We won't close this, just move it up a bit. |
+1 |
You are welcome :) @smileyj68 I don't understand why @extend can't be used , could you elaborate, please? (this is not a complain, in case it sounds like that) |
I think that foundation uses libsass (C/C++) instead of Sass (ruby) for the compiling process, and libsass has some limitations : |
I completely agree that the grid would be an ideal candidate for sass placeholders, however, this would make debugging difficult. I can understand the grid without having to look at the CSS rules. Having said that, I hate bloating my markup with something like below So I actually extend foundation's grid in a separate layout.scss file. So my |
@rvinay88 I don't really get what you explain about readability or debugging, could you please explain it? Are you refering to the code in the browser? Otherwise, if you are refering to the scss files, it's as easy as "regular" foundation, since I used the same names for my placeholders as Foundation uses. So, that bloated code would be: .tab-container{
@extend %large-6;
@extend %medium-8;
@extend %small-12;
(columns is not needed)
@extend %large-centered;
@extend %medium-centered;
} It's basically the same as applying the code to the HTML... just doing it in the CSS, where it should be. |
Like. if you think about 100 places where you need to extend %large-6 I know we can work around but do you think we need that kind of chaining? |
@rvinay88 Using Firesass (or a similar solution) you get detail info about where that was set in the original files. By the way, I'm not saying everybody should use this. However, both sass mixins and html classes are provided as options for people to choose from... Placeholders could be offered to, they can be easily turned on an off (commenting the imports the same as the rest of the framework) so people could use them if they wanted and, if not, no side effect (since placeholders wouldn't be compiled anyway). |
Hey cmoralesweb, I agree with you. I like the idea and I have a few points to make
|
:) Do you want me to try the loop and include the xlarge and xxlarge options? |
Yes! I added this topic in the forum as well, so we can take discussions there and keep your PR discussion free |
Ok, great! I'll try that and upload the commits when I have some time. |
Hey @cmoralesweb Can you give me your email? |
@smileyj68 Could you expand a little more on libsass issue with @extends please? I read the article posted by @maximelebreton but I am not sure if that means we cannot use @extend at all. |
@rvinay88 I've just sent you an email ;) |
@cmoralesweb didn't receive it..could you please resend or hit me up on twitter? |
Hey @rvinay88 F6 will be rewritten from the ground up, so this will not be accepted as a pull request. I am however going to open an issue for @extend in Foundation6 so that we can consider its use during the brainstorming and development of Foundation 6. Thanks! |
I don't like to put presentational classes in my HTML, such as class="small-5 preffix-1" . This can be avoided in Foundation using mixings, but that usually leads to repeated code. A great way to have the best of both worlds is to use placeholders (as explained by http://ianstormtaylor.com/oocss-plus-sass-is-the-best-way-to-css/ )
I've created placeholders for Foundation grid.