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

Icon classes as mixins #3933

Closed
ryanisinallofus opened this issue Jun 25, 2012 · 4 comments
Closed

Icon classes as mixins #3933

ryanisinallofus opened this issue Jun 25, 2012 · 4 comments

Comments

@ryanisinallofus
Copy link

In this file: (https://github.com/twitter/bootstrap/blob/master/less/sprites.less)

Lines 17, 18

[class^="icon-"],
[class*=" icon-"] 

happens in DOM. Doesn't this make each sprite class like icon-ok unavailable for mixing in?

.my-icon {
  .icon-ok;
}

I mean I CAN mix it in but all I get is what's on line 46 and only what's on line 46.

.icon-ok                 { background-position: -288px 0; }

Or hopefully I'm just doing it wrong.

@ryanisinallofus
Copy link
Author

Work around was to use icon-blank in the dom so the class would inherit all the base icon stuff. Then I can mixin the correct icon-x classes when I need them with no js.

@mdo
Copy link
Member

mdo commented Jun 25, 2012

Classes are not guaranteed to be mixins in Bootstrap. The sprites are built as is to serve a specific purpose and mixins are not that at this time.

@mdo mdo closed this as completed Jun 25, 2012
@ryanisinallofus
Copy link
Author

thanks

@ryanisinallofus
Copy link
Author

If I submitted a patch for this would you think about it? Every class is mixinable in Less. It would be cool if every class in Bootstrap was too.

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