Skip to content

Add @extend Sass directive ? #1021

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

Closed
MinerCrafter opened this issue Nov 5, 2012 · 2 comments
Closed

Add @extend Sass directive ? #1021

MinerCrafter opened this issue Nov 5, 2012 · 2 comments

Comments

@MinerCrafter
Copy link

Hello,

Sass offer a practical directive: @extend.

http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#extend

Example :

.error {
  border: 1px #f00;
  background: #fdd;
}
.error.intrusion {
  font-size: 1.3em;
  font-weight: bold;
}
.badError {
  @extend .error;
  border-width: 3px;
}

Result :

.error, .badError {
  border: 1px #f00;
  background: #fdd;
}
.error.intrusion,
.badError.intrusion {
  font-size: 1.3em;
  font-weight: bold;
}
.badError {
  border-width: 3px;
}

I use Twitter Bootstrap. I try to not edit his source code, i add my Less code after Bootstrap's code.
the @extend directive can be usefull to avoid code duplication !

What do you think about this ?

(Sorry, but i don't speak english very well).

Regards.

@lukeapage
Copy link
Member

duplicate of #509.

in progress on the 1.4.0 branch

@MinerCrafter
Copy link
Author

Thanks a lot for your reply :).

Sory for the duplicate content.

Regards.

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