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

[Table] Don't at-root the inner table styles. Makes it impossible to namespace #7454

Merged
merged 2 commits into from
Jan 4, 2016

Conversation

tjhiggins
Copy link

Unsure the original reason for the @at-root, but this mixin gets set on the table anyways.

@gakimball
Copy link
Contributor

I'd like to make this configurable instead. The reason we use @at-root is to keep the specificity lower. For example, the selector thead is better than table thead. However, that's not what you want if you're applying the mixin to a class. Then you need the nesting.

You could add a parameter to the mixin like $nest. If it's false, it uses @at-root, and if not, it doesn't.

@tjhiggins
Copy link
Author

@gakimball What would be the correct way to conditionally @at-root. Only thing that I can think of is another helper mixin.

@gakimball
Copy link
Contributor

It'll look a bit messy, but yeah, that's a solution. It can be a private mixin, so we won't document it anywhere. The code structure will look something like this:

@mixin -zf-table-children-styles {
  // ...
}

@mixin table(
  $stripe: $table-stripe,
  $nest: false
) {
  @if $nest {
    @include -zf-table-children-styles;
  }
  @else {
    @at-root {
      @include -zf-table-children-styles;
    }
  }
}

@tjhiggins
Copy link
Author

@gakimball Updated. Is this what you had in mind or should there be a global variable (table-nest) in _settings?

@gakimball
Copy link
Contributor

Nah, no global variable is needed. Thanks for implementing the feedback! :)

@gakimball gakimball closed this Jan 4, 2016
gakimball added a commit that referenced this pull request Jan 4, 2016
[Table] Don't at-root the inner table styles. Makes it impossible to namespace
@gakimball gakimball merged commit 41f9c50 into foundation:develop Jan 4, 2016
@xzyfer
Copy link

xzyfer commented Apr 17, 2016

It's worth nothing this usage of at-root is currently incompatible with LibSass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants