diff --git a/packages/core/src/_accessibility.scss b/packages/core/src/_accessibility.scss index ce0ad7e3e8..d96318c28d 100644 --- a/packages/core/src/_accessibility.scss +++ b/packages/core/src/_accessibility.scss @@ -5,13 +5,13 @@ @include focus-outline(); } -.pt-focus-disabled :focus { +.#{$ns}-focus-disabled :focus { // override any focus outline anywhere // stylelint-disable declaration-no-important outline: none !important; // special override for checkbox etc which render focus on a separate element - ~ .pt-control-indicator { + ~ .#{$ns}-control-indicator { outline: none !important; } } diff --git a/packages/core/src/_typography.scss b/packages/core/src/_typography.scss index 8c053b388a..91408fa86d 100644 --- a/packages/core/src/_typography.scss +++ b/packages/core/src/_typography.scss @@ -12,7 +12,7 @@ hr { border: none; border-bottom: 1px solid $pt-divider-black; - .pt-dark & { + .#{$ns}-dark & { border-color: $pt-dark-divider-white; } } @@ -37,12 +37,12 @@ Fonts Markup:
Blueprint components react overlay date picker.
-.pt-monospace-text - Use a monospace font (ideal for code) +.#{$ns}-monospace-text - Use a monospace font (ideal for code) Styleguide fonts */ -.pt-monospace-text { +.#{$ns}-monospace-text { @include monospace-typography(); } @@ -86,17 +86,17 @@ UI text Markup:
Blueprint components react overlay date picker.
-.pt-ui-text - Default UI text. This is applied to the document body as part of core styles. -.pt-ui-text-large - Larger UI text. +.#{$ns}-ui-text - Default UI text. This is applied to the document body as part of core styles. +.#{$ns}-ui-text-large - Larger UI text. -Styleguide pt-ui-text +Styleguide ui-text */ -.pt-ui-text { +.#{$ns}-ui-text { @include base-typography(); } -.pt-ui-text-large { +.#{$ns}-ui-text-large { line-height: 1.25; font-size: $pt-font-size-large; } @@ -107,23 +107,23 @@ Running text Markup:

Longform text, such as rendered Markdown documents, benefit from additional spacing and slightly -large font size. Apply .pt-running-text to the parent element to adjust spacing for the following +large font size. Apply .#{$ns}-running-text to the parent element to adjust spacing for the following elements:

New section

And another paragraph.

-.pt-running-text - Apply larger font size and additional spacing. +.#{$ns}-running-text - Apply larger font size and additional spacing. -Styleguide pt-running-text +Styleguide running-text */ -.pt-running-text { +.#{$ns}-running-text { @include running-typography(); @each $header, $props in $headers { @@ -134,7 +134,7 @@ Styleguide pt-running-text } } -.pt-running-text-small { +.#{$ns}-running-text-small { @include running-typography-small(); } @@ -169,12 +169,12 @@ a { } code, - .pt-dark & code { + .#{$ns}-dark & code { color: inherit; } - .pt-dark &, - .pt-dark &:hover { + .#{$ns}-dark &, + .#{$ns}-dark &:hover { color: $pt-dark-link-color; #{$icon-classes} { @@ -222,7 +222,7 @@ code { padding: 2px 5px; color: $pt-code-text-color; - .pt-dark & { + .#{$ns}-dark & { box-shadow: inset border-shadow(0.4); background: $pt-dark-code-background-color; color: $pt-dark-code-text-color; @@ -252,7 +252,7 @@ pre { font-size: inherit; } - .pt-dark & { + .#{$ns}-dark & { box-shadow: inset 0 0 0 1px $pt-dark-divider-black; background: $pt-dark-code-background-color; color: $pt-dark-text-color; @@ -296,7 +296,7 @@ blockquote { margin-bottom: 0; } - .pt-dark & { + .#{$ns}-dark & { border-color: rgba($gray2, 0.5); } } @@ -316,8 +316,8 @@ Markup:
  • Item the third
  • -.pt-list - Add a little spacing between items for readability. -.pt-list-unstyled - Remove all list styling (including indicators) so you can add your own. +.#{$ns}-list - Add a little spacing between items for readability. +.#{$ns}-list-unstyled - Remove all list styling (including indicators) so you can add your own. Styleguide lists */ @@ -328,9 +328,9 @@ ul { padding-left: $pt-grid-size * 4; } -.pt-list, -.pt-running-text ul, -.pt-running-text ol { +.#{$ns}-list, +.#{$ns}-running-text ul, +.#{$ns}-running-text ol { li:not(:last-child) { padding-bottom: $pt-grid-size / 2; } @@ -346,7 +346,7 @@ ul { } } -.pt-list-unstyled { +.#{$ns}-list-unstyled { margin: 0; padding: 0; list-style: none; @@ -364,22 +364,22 @@ Markup: Blueprint components react overlay date picker. Breadcrumbs dialog progress non-ideal state. -.pt-text-muted - Changes text color to a gentler gray. -.pt-text-overflow-ellipsis - Truncates a single line of text with an ellipsis if it overflows its +.#{$ns}-text-muted - Changes text color to a gentler gray. +.#{$ns}-text-overflow-ellipsis - Truncates a single line of text with an ellipsis if it overflows its container. Styleguide utilities */ -.pt-text-muted { +.#{$ns}-text-muted { color: $pt-text-color-muted; - .pt-dark & { + .#{$ns}-dark & { color: $pt-dark-text-color-muted; } } -.pt-text-overflow-ellipsis { +.#{$ns}-text-overflow-ellipsis { @include overflow-ellipsis(); } @@ -388,24 +388,24 @@ Right-to-left text Markup:

    Arabic:

    -

    +

    لكل لأداء بمحاولة من. مدينة الواقعة يبق أي, وإعلان وقوعها، حول كل, حدى عجّل مشروط الخاسرة قد. من الذود تكبّد بين, و لها واحدة الأراضي. عل الصفحة والروسية يتم, أي للحكومة استعملت شيء. أم وصل زهاء اليا

    Hebrew:

    -

    +

    כדי על עזרה יידיש הבהרה, מלא באגים טכניים דת. תנך או ברית ביולי. כתב בה הטבע למנוע, דת כלים פיסיקה החופשית זכר. מתן החלל מאמרשיחהצפה ב. הספרות אנציקלופדיה אם זכר, על שימושי שימושיים תאולוגיה עזה

    -Styleguide pt-rtl +Styleguide rtl */ -.pt-rtl { +.#{$ns}-rtl { text-align: right; } -.pt-dark { +.#{$ns}-dark { color: $pt-dark-text-color; @each $header, $props in $headers { diff --git a/packages/core/src/common/_flex.scss b/packages/core/src/common/_flex.scss index 5f150bdfe5..b44d7db1b4 100644 --- a/packages/core/src/common/_flex.scss +++ b/packages/core/src/common/_flex.scss @@ -5,7 +5,7 @@ // supply `$margin` to put space between each child. // supply `$inline: inline` to use `display: flex-inline`. // customize `flex: 1 1` child selector with $fill. -@mixin pt-flex-container($direction: row, $margin: none, $inline: none, $fill: ".pt-fill") { +@mixin pt-flex-container($direction: row, $margin: none, $inline: none, $fill: ".#{$ns}-fill") { @if $inline == inline or $inline == true { display: inline-flex; } @else { diff --git a/packages/core/src/common/_react-transition.scss b/packages/core/src/common/_react-transition.scss index 3d45b4b63b..ab8b4544a4 100644 --- a/packages/core/src/common/_react-transition.scss +++ b/packages/core/src/common/_react-transition.scss @@ -10,8 +10,8 @@ value). For enter & appear transitions, each property will transition from its i value. For exit transitions, each property will transition in reverse, from final to initial. **Simple example:** -`@include react-transition("pt-popover", (opacity: 0 1), $before: "&");` -Transition named "pt-popover" moves opacity from 0 to 1. `"&"` indicates that the +`@include react-transition("popover", (opacity: 0 1), $before: "&");` +Transition named "popover" moves opacity from 0 to 1. `"&"` indicates that the Transition classes are expected to be applied to this element, where the mixin is invoked. **Params:** @@ -52,8 +52,8 @@ If `enter` phase is given then `appear` phase will be generated at the same time If `exit` phase is given then property values are animated in reverse, from final to initial. **Example:** -@include react-transition-phase(pt-toast, enter, $enter-translate, $before: "&"); -@include react-transition-phase(pt-toast, leave, $leave-blur, $pt-transition-duration * 3, $before: "&"); +@include react-transition-phase(toast, enter, $enter-translate, $before: "&"); +@include react-transition-phase(toast, leave, $leave-blur, $pt-transition-duration * 3, $before: "&"); */ @mixin react-transition-phase( $name, diff --git a/packages/core/src/common/_variables.scss b/packages/core/src/common/_variables.scss index 0fecc4f0ce..2902f7e4af 100644 --- a/packages/core/src/common/_variables.scss +++ b/packages/core/src/common/_variables.scss @@ -4,7 +4,10 @@ @import "colors"; @import "mixins"; -// easily the most important variable, so it comes first +// Namespace appended to the beginning of each CSS class: `.#{$ns}-button`. +$ns: "pt" !default; + +// easily the most important variable, so it comes up top // (so other variables can use it to define themselves) $pt-grid-size: 10px !default; diff --git a/packages/core/src/common/classes.ts b/packages/core/src/common/classes.ts index cb21b97095..0c689eac11 100644 --- a/packages/core/src/common/classes.ts +++ b/packages/core/src/common/classes.ts @@ -8,26 +8,26 @@ import { Elevation } from "../components/card/card"; import { Alignment } from "./alignment"; import { Intent } from "./intent"; -// tslint:disable:blueprint-classes-constants +const NS = process.env.BLUEPRINT_NAMESPACE || "pt"; // modifiers -export const ACTIVE = "pt-active"; -export const ALIGN_LEFT = "pt-align-left"; -export const ALIGN_RIGHT = "pt-align-right"; -export const DARK = "pt-dark"; -export const DISABLED = "pt-disabled"; -export const FILL = "pt-fill"; -export const FIXED = "pt-fixed"; -export const FIXED_TOP = "pt-fixed-top"; -export const INLINE = "pt-inline"; -export const INTERACTIVE = "pt-interactive"; -export const LARGE = "pt-large"; -export const LOADING = "pt-loading"; -export const MINIMAL = "pt-minimal"; -export const MULTILINE = "pt-multiline"; -export const ROUND = "pt-round"; -export const SMALL = "pt-small"; -export const VERTICAL = "pt-vertical"; +export const ACTIVE = `${NS}-active`; +export const ALIGN_LEFT = `${NS}-align-left`; +export const ALIGN_RIGHT = `${NS}-align-right`; +export const DARK = `${NS}-dark`; +export const DISABLED = `${NS}-disabled`; +export const FILL = `${NS}-fill`; +export const FIXED = `${NS}-fixed`; +export const FIXED_TOP = `${NS}-fixed-top`; +export const INLINE = `${NS}-inline`; +export const INTERACTIVE = `${NS}-interactive`; +export const LARGE = `${NS}-large`; +export const LOADING = `${NS}-loading`; +export const MINIMAL = `${NS}-minimal`; +export const MULTILINE = `${NS}-multiline`; +export const ROUND = `${NS}-round`; +export const SMALL = `${NS}-small`; +export const VERTICAL = `${NS}-vertical`; export const ELEVATION_0 = elevationClass(Elevation.ZERO); export const ELEVATION_1 = elevationClass(Elevation.ONE); @@ -41,206 +41,213 @@ export const INTENT_WARNING = intentClass(Intent.WARNING); export const INTENT_DANGER = intentClass(Intent.DANGER); // text utilities -export const TEXT_MUTED = "pt-text-muted"; -export const TEXT_OVERFLOW_ELLIPSIS = "pt-text-overflow-ellipsis"; -export const UI_TEXT = "pt-ui-text"; -export const UI_TEXT_LARGE = "pt-ui-text-large"; -export const RUNNING_TEXT = "pt-running-text"; -export const RUNNING_TEXT_SMALL = "pt-running-text-small"; -export const MONOSPACE_TEXT = "pt-monospace-text"; +export const TEXT_MUTED = `${NS}-text-muted`; +export const TEXT_OVERFLOW_ELLIPSIS = `${NS}-text-overflow-ellipsis`; +export const UI_TEXT = `${NS}-ui-text`; +export const UI_TEXT_LARGE = `${NS}-ui-text-large`; +export const RUNNING_TEXT = `${NS}-running-text`; +export const RUNNING_TEXT_SMALL = `${NS}-running-text-small`; +export const MONOSPACE_TEXT = `${NS}-monospace-text`; -export const FOCUS_DISABLED = "pt-focus-disabled"; +export const FOCUS_DISABLED = `${NS}-focus-disabled`; // lists -export const LIST = "pt-list"; -export const LIST_UNSTYLED = "pt-list-unstyled"; +export const LIST = `${NS}-list`; +export const LIST_UNSTYLED = `${LIST}-unstyled`; // components -export const ALERT = "pt-alert"; -export const ALERT_BODY = "pt-alert-body"; -export const ALERT_CONTENTS = "pt-alert-contents"; -export const ALERT_FOOTER = "pt-alert-footer"; - -export const BREADCRUMB = "pt-breadcrumb"; -export const BREADCRUMB_CURRENT = "pt-breadcrumb-current"; -export const BREADCRUMBS = "pt-breadcrumbs"; -export const BREADCRUMBS_COLLAPSED = "pt-breadcrumbs-collapsed"; - -export const BUTTON = "pt-button"; -export const BUTTON_GROUP = "pt-button-group"; -export const BUTTON_SPINNER = "pt-button-spinner"; -export const BUTTON_TEXT = "pt-button-text"; - -export const CALLOUT = "pt-callout"; -export const CALLOUT_ICON = "pt-callout-icon"; -export const CALLOUT_TITLE = "pt-callout-title"; - -export const CARD = "pt-card"; - -export const COLLAPSE = "pt-collapse"; -export const COLLAPSE_BODY = "pt-collapse-body"; - -export const COLLAPSIBLE_LIST = "pt-collapse-list"; - -export const CONTEXT_MENU = "pt-context-menu"; -export const CONTEXT_MENU_POPOVER_TARGET = "pt-context-menu-popover-target"; - -export const CONTROL = "pt-control"; -export const CONTROL_GROUP = "pt-control-group"; -export const CONTROL_INDICATOR = "pt-control-indicator"; - -export const DIALOG = "pt-dialog"; -export const DIALOG_CONTAINER = "pt-dialog-container"; -export const DIALOG_BODY = "pt-dialog-body"; -export const DIALOG_CLOSE_BUTTON = "pt-dialog-close-button"; -export const DIALOG_FOOTER = "pt-dialog-footer"; -export const DIALOG_FOOTER_ACTIONS = "pt-dialog-footer-actions"; -export const DIALOG_HEADER = "pt-dialog-header"; -export const DIALOG_HEADER_TITLE = "pt-dialog-header-title"; - -export const EDITABLE_TEXT = "pt-editable-text"; -export const EDITABLE_TEXT_CONTENT = "pt-editable-content"; -export const EDITABLE_TEXT_EDITING = "pt-editable-editing"; -export const EDITABLE_TEXT_INPUT = "pt-editable-input"; -export const EDITABLE_TEXT_PLACEHOLDER = "pt-editable-placeholder"; - -export const FLEX_EXPANDER = "pt-flex-expander"; - -export const HTML_TABLE = "pt-html-table"; -export const HTML_TABLE_STRIPED = "pt-html-table-striped"; -export const HTML_TABLE_BORDERED = "pt-html-table-bordered"; - -export const INPUT = "pt-input"; -export const INPUT_GROUP = "pt-input-group"; -export const INPUT_ACTION = "pt-input-action"; - -export const CHECKBOX = "pt-checkbox"; -export const RADIO = "pt-radio"; -export const SWITCH = "pt-switch"; -export const FILE_INPUT = "pt-file-input"; -export const FILE_UPLOAD_INPUT = "pt-file-upload-input"; - -export const INPUT_GHOST = "pt-input-ghost"; - -export const KEY = "pt-key"; -export const KEY_COMBO = "pt-key-combo"; -export const MODIFIER_KEY = "pt-modifier-key"; - -export const HOTKEY = "pt-hotkey"; -export const HOTKEY_LABEL = "pt-hotkey-label"; -export const HOTKEY_GROUP = "pt-hotkey-group"; -export const HOTKEY_COLUMN = "pt-hotkey-column"; -export const HOTKEY_DIALOG = "pt-hotkey-dialog"; - -export const LABEL = "pt-label"; -export const FORM_GROUP = "pt-form-group"; -export const FORM_CONTENT = "pt-form-content"; -export const FORM_HELPER_TEXT = "pt-form-helper-text"; - -export const MENU = "pt-menu"; -export const MENU_ITEM = "pt-menu-item"; -export const MENU_ITEM_LABEL = "pt-menu-item-label"; -export const MENU_SUBMENU = "pt-submenu"; -export const MENU_DIVIDER = "pt-menu-divider"; -export const MENU_HEADER = "pt-menu-header"; - -export const NAVBAR = "pt-navbar"; -export const NAVBAR_GROUP = "pt-navbar-group"; -export const NAVBAR_HEADING = "pt-navbar-heading"; -export const NAVBAR_DIVIDER = "pt-navbar-divider"; - -export const NON_IDEAL_STATE = "pt-non-ideal-state"; -export const NON_IDEAL_STATE_ACTION = "pt-non-ideal-state-action"; -export const NON_IDEAL_STATE_DESCRIPTION = "pt-non-ideal-state-description"; -export const NON_IDEAL_STATE_ICON = "pt-non-ideal-state-icon"; -export const NON_IDEAL_STATE_TITLE = "pt-non-ideal-state-title"; -export const NON_IDEAL_STATE_VISUAL = "pt-non-ideal-state-visual"; - -export const NUMERIC_INPUT = "pt-numeric-input"; - -export const OVERLAY = "pt-overlay"; -export const OVERLAY_BACKDROP = "pt-overlay-backdrop"; -export const OVERLAY_CONTENT = "pt-overlay-content"; -export const OVERLAY_INLINE = "pt-overlay-inline"; -export const OVERLAY_OPEN = "pt-overlay-open"; -export const OVERLAY_SCROLL_CONTAINER = "pt-overlay-scroll-container"; - -export const POPOVER = "pt-popover"; -export const POPOVER_ARROW = "pt-popover-arrow"; -export const POPOVER_BACKDROP = "pt-popover-backdrop"; -export const POPOVER_CONTENT = "pt-popover-content"; -export const POPOVER_CONTENT_SIZING = "pt-popover-content-sizing"; -export const POPOVER_DISMISS = "pt-popover-dismiss"; -export const POPOVER_DISMISS_OVERRIDE = "pt-popover-dismiss-override"; -export const POPOVER_OPEN = "pt-popover-open"; -export const POPOVER_TARGET = "pt-popover-target"; -export const POPOVER_WRAPPER = "pt-popover-wrapper"; -export const TRANSITION_CONTAINER = "pt-transition-container"; - -export const PROGRESS_BAR = "pt-progress-bar"; -export const PROGRESS_METER = "pt-progress-meter"; -export const PROGRESS_NO_STRIPES = "pt-no-stripes"; -export const PROGRESS_NO_ANIMATION = "pt-no-animation"; - -export const PORTAL = "pt-portal"; - -export const SELECT = "pt-select"; - -export const SKELETON = "pt-skeleton"; - -export const SLIDER = "pt-slider"; -export const SLIDER_HANDLE = "pt-slider-handle"; -export const SLIDER_LABEL = "pt-slider-label"; -export const SLIDER_PROGRESS = "pt-slider-progress"; -export const RANGE_SLIDER = "pt-range-slider"; - -export const SPINNER = "pt-spinner"; -export const SPINNER_HEAD = "pt-spinner-head"; -export const SPINNER_NO_SPIN = "pt-no-spin"; -export const SPINNER_TRACK = "pt-spinner-track"; -export const SPINNER_SVG_CONTAINER = "pt-spinner-svg-container"; -export const SVG_SPINNER = "pt-svg-spinner"; - -export const TAB = "pt-tab"; -export const TAB_INDICATOR = "pt-tab-indicator"; -export const TAB_INDICATOR_WRAPPER = "pt-tab-indicator-wrapper"; -export const TAB_LIST = "pt-tab-list"; -export const TAB_PANEL = "pt-tab-panel"; -export const TABS = "pt-tabs"; - -export const TAG = "pt-tag"; -export const TAG_REMOVABLE = "pt-tag-removable"; -export const TAG_REMOVE = "pt-tag-remove"; - -export const TAG_INPUT = "pt-tag-input"; -export const TAG_INPUT_ICON = "pt-tag-input-icon"; -export const TAG_INPUT_VALUES = "pt-tag-input-values"; - -export const TOAST = "pt-toast"; -export const TOAST_CONTAINER = "pt-toast-container"; -export const TOAST_MESSAGE = "pt-toast-message"; - -export const TOOLTIP = "pt-tooltip"; -export const TOOLTIP_INDICATOR = "pt-tooltip-indicator"; - -export const TREE = "pt-tree"; -export const TREE_NODE = "pt-tree-node"; -export const TREE_NODE_CARET = "pt-tree-node-caret"; -export const TREE_NODE_CARET_CLOSED = "pt-tree-node-caret-closed"; -export const TREE_NODE_CARET_NONE = "pt-tree-node-caret-none"; -export const TREE_NODE_CARET_OPEN = "pt-tree-node-caret-open"; -export const TREE_NODE_CONTENT = "pt-tree-node-content"; -export const TREE_NODE_EXPANDED = "pt-tree-node-expanded"; -export const TREE_NODE_ICON = "pt-tree-node-icon"; -export const TREE_NODE_LABEL = "pt-tree-node-label"; -export const TREE_NODE_LIST = "pt-tree-node-list"; -export const TREE_NODE_SECONDARY_LABEL = "pt-tree-node-secondary-label"; -export const TREE_NODE_SELECTED = "pt-tree-node-selected"; -export const TREE_ROOT = "pt-tree-root"; - -export const ICON = "pt-icon"; -export const ICON_STANDARD = "pt-icon-standard"; -export const ICON_LARGE = "pt-icon-large"; +export const ALERT = `${NS}-alert`; +export const ALERT_BODY = `${ALERT}-body`; +export const ALERT_CONTENTS = `${ALERT}-contents`; +export const ALERT_FOOTER = `${ALERT}-footer`; + +export const BREADCRUMB = `${NS}-breadcrumb`; +export const BREADCRUMB_CURRENT = `${BREADCRUMB}-current`; +export const BREADCRUMBS = `${BREADCRUMB}s`; +export const BREADCRUMBS_COLLAPSED = `${BREADCRUMB}s-collapsed`; + +export const BUTTON = `${NS}-button`; +export const BUTTON_GROUP = `${BUTTON}-group`; +export const BUTTON_SPINNER = `${BUTTON}-spinner`; +export const BUTTON_TEXT = `${BUTTON}-text`; + +export const CALLOUT = `${NS}-callout`; +export const CALLOUT_ICON = `${CALLOUT}-icon`; +export const CALLOUT_TITLE = `${CALLOUT}-title`; + +export const CARD = `${NS}-card`; + +export const COLLAPSE = `${NS}-collapse`; +export const COLLAPSE_BODY = `${COLLAPSE}-body`; + +export const COLLAPSIBLE_LIST = `${NS}-collapse-list`; + +export const CONTEXT_MENU = `${NS}-context-menu`; +export const CONTEXT_MENU_POPOVER_TARGET = `${CONTEXT_MENU}-popover-target`; + +export const CONTROL_GROUP = `${NS}-control-group`; + +export const DIALOG = `${NS}-dialog`; +export const DIALOG_CONTAINER = `${DIALOG}-container`; +export const DIALOG_BODY = `${DIALOG}-body`; +export const DIALOG_CLOSE_BUTTON = `${DIALOG}-close-button`; +export const DIALOG_FOOTER = `${DIALOG}-footer`; +export const DIALOG_FOOTER_ACTIONS = `${DIALOG}-footer-actions`; +export const DIALOG_HEADER = `${DIALOG}-header`; +export const DIALOG_HEADER_TITLE = `${DIALOG}-header-title`; + +export const EDITABLE_TEXT = `${NS}-editable-text`; +export const EDITABLE_TEXT_CONTENT = `${EDITABLE_TEXT}-content`; +export const EDITABLE_TEXT_EDITING = `${EDITABLE_TEXT}-editing`; +export const EDITABLE_TEXT_INPUT = `${EDITABLE_TEXT}-input`; +export const EDITABLE_TEXT_PLACEHOLDER = `${EDITABLE_TEXT}-placeholder`; + +export const FLEX_EXPANDER = `${NS}-flex-expander`; + +export const HTML_TABLE = `${NS}-html-table`; +export const HTML_TABLE_STRIPED = `${HTML_TABLE}-striped`; +export const HTML_TABLE_BORDERED = `${HTML_TABLE}-bordered`; + +export const INPUT = `${NS}-input`; +export const INPUT_GHOST = `${INPUT}-ghost`; +export const INPUT_GROUP = `${INPUT}-group`; +export const INPUT_ACTION = `${INPUT}-action`; + +export const CONTROL = `${NS}-control`; +export const CONTROL_INDICATOR = `${CONTROL}-indicator`; +export const CHECKBOX = `${NS}-checkbox`; +export const RADIO = `${NS}-radio`; +export const SWITCH = `${NS}-switch`; +export const FILE_INPUT = `${NS}-file-input`; +export const FILE_UPLOAD_INPUT = `${NS}-file-upload-input`; + +export const KEY = `${NS}-key`; +export const KEY_COMBO = `${KEY}-combo`; +export const MODIFIER_KEY = `${NS}-modifier-key`; + +export const HOTKEY = `${NS}-hotkey`; +export const HOTKEY_LABEL = `${HOTKEY}-label`; +export const HOTKEY_GROUP = `${HOTKEY}-group`; +export const HOTKEY_COLUMN = `${HOTKEY}-column`; +export const HOTKEY_DIALOG = `${HOTKEY}-dialog`; + +export const LABEL = `${NS}-label`; +export const FORM_GROUP = `${NS}-form-group`; +export const FORM_CONTENT = `${NS}-form-content`; +export const FORM_HELPER_TEXT = `${NS}-form-helper-text`; + +export const MENU = `${NS}-menu`; +export const MENU_ITEM = `${MENU}-item`; +export const MENU_ITEM_LABEL = `${MENU_ITEM}-label`; +export const MENU_SUBMENU = `${NS}-submenu`; +export const MENU_DIVIDER = `${MENU}-divider`; +export const MENU_HEADER = `${MENU}-header`; + +export const NAVBAR = `${NS}-navbar`; +export const NAVBAR_GROUP = `${NAVBAR}-group`; +export const NAVBAR_HEADING = `${NAVBAR}-heading`; +export const NAVBAR_DIVIDER = `${NAVBAR}-divider`; + +export const NON_IDEAL_STATE = `${NS}-non-ideal-state`; +export const NON_IDEAL_STATE_ACTION = `${NON_IDEAL_STATE}-action`; +export const NON_IDEAL_STATE_DESCRIPTION = `${NON_IDEAL_STATE}-description`; +export const NON_IDEAL_STATE_ICON = `${NON_IDEAL_STATE}-icon`; +export const NON_IDEAL_STATE_TITLE = `${NON_IDEAL_STATE}-title`; +export const NON_IDEAL_STATE_VISUAL = `${NON_IDEAL_STATE}-visual`; + +export const NUMERIC_INPUT = `${NS}-numeric-input`; + +export const OVERLAY = `${NS}-overlay`; +export const OVERLAY_BACKDROP = `${OVERLAY}-backdrop`; +export const OVERLAY_CONTENT = `${OVERLAY}-content`; +export const OVERLAY_INLINE = `${OVERLAY}-inline`; +export const OVERLAY_OPEN = `${OVERLAY}-open`; +export const OVERLAY_SCROLL_CONTAINER = `${OVERLAY}-scroll-container`; + +export const POPOVER = `${NS}-popover`; +export const POPOVER_ARROW = `${POPOVER}-arrow`; +export const POPOVER_BACKDROP = `${POPOVER}-backdrop`; +export const POPOVER_CONTENT = `${POPOVER}-content`; +export const POPOVER_CONTENT_SIZING = `${POPOVER_CONTENT}-sizing`; +export const POPOVER_DISMISS = `${POPOVER}-dismiss`; +export const POPOVER_DISMISS_OVERRIDE = `${POPOVER_DISMISS}-override`; +export const POPOVER_OPEN = `${POPOVER}-open`; +export const POPOVER_TARGET = `${POPOVER}-target`; +export const POPOVER_WRAPPER = `${POPOVER}-wrapper`; +export const TRANSITION_CONTAINER = `${NS}-transition-container`; + +export const PROGRESS_BAR = `${NS}-progress-bar`; +export const PROGRESS_METER = `${NS}-progress-meter`; +export const PROGRESS_NO_STRIPES = `${NS}-no-stripes`; +export const PROGRESS_NO_ANIMATION = `${NS}-no-animation`; + +export const PORTAL = `${NS}-portal`; + +export const SELECT = `${NS}-select`; + +export const SKELETON = `${NS}-skeleton`; + +export const SLIDER = `${NS}-slider`; +export const SLIDER_HANDLE = `${SLIDER}-handle`; +export const SLIDER_LABEL = `${SLIDER}-label`; +export const SLIDER_PROGRESS = `${SLIDER}-progress`; +export const RANGE_SLIDER = `${NS}-range-slider`; + +export const SPINNER = `${NS}-spinner`; +export const SPINNER_HEAD = `${SPINNER}-head`; +export const SPINNER_NO_SPIN = `${NS}-no-spin`; +export const SPINNER_TRACK = `${SPINNER}-track`; +export const SPINNER_SVG_CONTAINER = `${SPINNER}-svg-container`; +export const SVG_SPINNER = `${NS}-svg-spinner`; + +export const TAB = `${NS}-tab`; +export const TAB_INDICATOR = `${TAB}-indicator`; +export const TAB_INDICATOR_WRAPPER = `${TAB_INDICATOR}-wrapper`; +export const TAB_LIST = `${TAB}-list`; +export const TAB_PANEL = `${TAB}-panel`; +export const TABS = `${TAB}s`; + +export const TAG = `${NS}-tag`; +export const TAG_REMOVABLE = `${TAG}-removable`; +export const TAG_REMOVE = `${TAG}-remove`; + +export const TAG_INPUT = `${NS}-tag-input`; +export const TAG_INPUT_ICON = `${TAG_INPUT}-icon`; +export const TAG_INPUT_VALUES = `${TAG_INPUT}-values`; + +export const TOAST = `${NS}-toast`; +export const TOAST_CONTAINER = `${TOAST}-container`; +export const TOAST_MESSAGE = `${TOAST}-message`; + +export const TOOLTIP = `${NS}-tooltip`; +export const TOOLTIP_INDICATOR = `${TOOLTIP}-indicator`; + +export const TREE = `${NS}-tree`; +export const TREE_NODE = `${NS}-tree-node`; +export const TREE_NODE_CARET = `${TREE_NODE}-caret`; +export const TREE_NODE_CARET_CLOSED = `${TREE_NODE_CARET}-closed`; +export const TREE_NODE_CARET_NONE = `${TREE_NODE_CARET}-none`; +export const TREE_NODE_CARET_OPEN = `${TREE_NODE_CARET}-open`; +export const TREE_NODE_CONTENT = `${TREE_NODE}-content`; +export const TREE_NODE_EXPANDED = `${TREE_NODE}-expanded`; +export const TREE_NODE_ICON = `${TREE_NODE}-icon`; +export const TREE_NODE_LABEL = `${TREE_NODE}-label`; +export const TREE_NODE_LIST = `${TREE_NODE}-list`; +export const TREE_NODE_SECONDARY_LABEL = `${TREE_NODE}-secondary-label`; +export const TREE_NODE_SELECTED = `${TREE_NODE}-selected`; +export const TREE_ROOT = `${NS}-tree-root`; + +export const ICON = `${NS}-icon`; +export const ICON_STANDARD = `${ICON}-standard`; +export const ICON_LARGE = `${ICON}-large`; + +/** + * Returns the namespace prefix for all Blueprint CSS classes. + * Customize this namespace at build time with the `process.env.BLUEPRINT_NAMESPACE` environment variable. + */ +export function getClassNamespace() { + return NS; +} /** Return CSS class for alignment. */ export function alignmentClass(alignment: Alignment) { @@ -258,7 +265,7 @@ export function elevationClass(elevation: Elevation) { if (elevation == null) { return undefined; } - return `pt-elevation-${elevation}`; + return `${NS}-elevation-${elevation}`; } /** Return CSS class for icon, whether or not 'pt-icon-' prefix is included */ @@ -266,7 +273,7 @@ export function iconClass(iconName?: string) { if (iconName == null) { return undefined; } - return iconName.indexOf("pt-icon-") === 0 ? iconName : `pt-icon-${iconName}`; + return iconName.indexOf(`${NS}-icon-`) === 0 ? iconName : `${NS}-icon-${iconName}`; } /** Return CSS class for intent. */ @@ -274,7 +281,5 @@ export function intentClass(intent = Intent.NONE) { if (intent == null || intent === Intent.NONE) { return undefined; } - return `pt-intent-${intent.toLowerCase()}`; + return `${NS}-intent-${intent.toLowerCase()}`; } - -// tslint:enable:blueprint-classes-constants diff --git a/packages/core/src/components/alert/_alert.scss b/packages/core/src/components/alert/_alert.scss index 9cd9a62139..8966c67391 100644 --- a/packages/core/src/components/alert/_alert.scss +++ b/packages/core/src/components/alert/_alert.scss @@ -3,27 +3,27 @@ @import "../../common/variables"; -.pt-alert { +.#{$ns}-alert { max-width: $pt-grid-size * 40; padding: $pt-grid-size * 2; } -.pt-alert-body { +.#{$ns}-alert-body { display: flex; - .pt-icon { + .#{$ns}-icon { margin-top: 0; margin-right: $pt-grid-size * 2; font-size: $pt-icon-size-large * 2; } } -.pt-alert-footer { +.#{$ns}-alert-footer { display: flex; flex-direction: row-reverse; margin-top: $pt-grid-size; - .pt-button { + .#{$ns}-button { margin-left: $pt-grid-size; } } diff --git a/packages/core/src/components/breadcrumbs/_breadcrumbs.scss b/packages/core/src/components/breadcrumbs/_breadcrumbs.scss index ea0a2c43b1..c78561e0bb 100644 --- a/packages/core/src/components/breadcrumbs/_breadcrumbs.scss +++ b/packages/core/src/components/breadcrumbs/_breadcrumbs.scss @@ -8,21 +8,21 @@ Breadcrumbs Markup: -