Skip to content

Instantly share code, notes, and snippets.

@Lochlan
Last active August 29, 2015 14:02
Show Gist options
  • Save Lochlan/c42b05cf925a3255673a to your computer and use it in GitHub Desktop.
Save Lochlan/c42b05cf925a3255673a to your computer and use it in GitHub Desktop.
CSS "namespacing"
// ----
// Sass (v3.3.8)
// Compass (v1.0.0.alpha.19)
// ----
// CSS "namespacing"
namespaceFoo {
@at-root {
&-bar {
content: 'bar';
}
&-baz {
content: 'baz';
}
&-qux {
content: 'qux';
}
}
}
namespaceFoo-bar {
content: 'bar';
}
namespaceFoo-baz {
content: 'baz';
}
namespaceFoo-qux {
content: 'qux';
}
@Lochlan
Copy link
Author

Lochlan commented Jul 12, 2014

Prefixing CSS classes with a unique string can help avoid name clashes. This is useful for code that is deployed on or accessed by one or more third-party sites.

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