-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
customize CSS namespace #2325
customize CSS namespace #2325
Conversation
@@ -4,6 +4,9 @@ | |||
@import "colors"; | |||
@import "mixins"; | |||
|
|||
$pt-namespace: "pt" !default; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not one var like $ns: "pt" !default
or $namespace: "pt" !default
or $blueprint-namespace: "pt" !default
?
use parent constant to derive child classesPreview: documentation | landing | table |
packages/core/src/common/classes.ts
Outdated
@@ -7,207 +7,239 @@ | |||
import { Alignment } from "./alignment"; | |||
import { Intent } from "./intent"; | |||
|
|||
const NS = "bp3"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this namespace is bp3 but the one above is pt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah oops shhhhhh
replace `@ns` in compile-docs-dataPreview: documentation | landing | table |
gonna pull out some changes from this PR into separate ones to shrink the diff. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally, I think using custom namespaces like this will create as many problems as it solves for us. For most users this won't affect them.
Changes lgtm
Merge branch 'develop' of github.com:palantir/blueprint into gg/custom-namespacePreview: documentation | landing | table |
only one `$ns` variablePreview: documentation | landing | table |
bring back env variable, namespace modifiersPreview: documentation | landing | table |
add Classes docs pagePreview: documentation | landing | table |
outstanding pt- namespace referencesPreview: documentation | landing | table |
support customizing the
pt-
namespace on all classes.new
$pt-namespace
(aliased as$ns
for brevity) Sass variable determines prefix for all generated CSS classes.use environment variable
process.env.BLUEPRINT_NAMESPACE
to customize prefix in JSclasses.ts
constants files.docs CSS examples can safely use
#{$ns}
in modifier lists and it will be replaced at runtime.TODO
Classes
) strings in JS code