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

customize CSS namespace #2325

Merged
merged 27 commits into from
Apr 19, 2018
Merged

customize CSS namespace #2325

merged 27 commits into from
Apr 19, 2018

Conversation

giladgray
Copy link
Contributor

@giladgray giladgray commented Mar 27, 2018

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 JS classes.ts constants files.
docs CSS examples can safely use #{$ns} in modifier lists and it will be replaced at runtime.

TODO

  • hardcoded (non-Classes) strings in JS code
  • hardcoded string in MD docs 😢
  • KSS styleguide IDs
  • documentation

@@ -4,6 +4,9 @@
@import "colors";
@import "mixins";

$pt-namespace: "pt" !default;
Copy link
Contributor

@llorca llorca Mar 27, 2018

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?

@giladgray giladgray changed the title custom CSS namespace customize CSS namespace Mar 28, 2018
@blueprint-bot
Copy link

use parent constant to derive child classes

Preview: documentation | landing | table

@@ -7,207 +7,239 @@
import { Alignment } from "./alignment";
import { Intent } from "./intent";

const NS = "bp3";
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah oops shhhhhh

@blueprint-bot
Copy link

replace `@ns` in compile-docs-data

Preview: documentation | landing | table

@giladgray
Copy link
Contributor Author

gonna pull out some changes from this PR into separate ones to shrink the diff.

Copy link
Contributor

@themadcreator themadcreator left a 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

@blueprint-bot
Copy link

Merge branch 'develop' of github.com:palantir/blueprint into gg/custom-namespace

Preview: documentation | landing | table

@blueprint-bot
Copy link

only one `$ns` variable

Preview: documentation | landing | table

@blueprint-bot
Copy link

bring back env variable, namespace modifiers

Preview: documentation | landing | table

@giladgray giladgray added this to the 3.0.0 milestone Apr 18, 2018
@blueprint-bot
Copy link

add Classes docs page

Preview: documentation | landing | table

@blueprint-bot
Copy link

outstanding pt- namespace references

Preview: documentation | landing | table

@giladgray giladgray merged commit 4d5bfb4 into develop Apr 19, 2018
@giladgray giladgray deleted the gg/custom-namespace branch April 19, 2018 22:10
This was referenced Apr 19, 2018
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.

5 participants