Skip to content

Commit

Permalink
Revert "Switch from @import to @use (#7074)"
Browse files Browse the repository at this point in the history
This reverts commit ce88ca4.
  • Loading branch information
ggdouglas authored Jan 13, 2025
1 parent 7010105 commit 762c04f
Show file tree
Hide file tree
Showing 148 changed files with 743 additions and 1,015 deletions.
2 changes: 1 addition & 1 deletion .stylelintrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"color-function-notation": "legacy",
"declaration-empty-line-before": null,
"no-invalid-position-at-import-rule": [true, {
"ignoreAtRules": ["use", "forward"]
"ignoreAtRules": ["use"]
}],
"scss/media-feature-value-dollar-variable": null,
"selector-max-universal": 1
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/_dark-theme.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2021 Palantir Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0.
@use "common/variables" as *;

.#{$ns}-dark {
// this tells the browser to use a dark theme UI, which is most useful for enabling
Expand Down
5 changes: 2 additions & 3 deletions packages/core/src/_reset.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// Copyright 2015 Palantir Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0.

@use "common/variables" as *;
@use "common/color-aliases" as *;
@use "common/mixins" as *;
@import "common/variables";
@import "common/mixins";

// Apply a natural box layout model to all elements, but allow components to change as necessary
html {
Expand Down
13 changes: 5 additions & 8 deletions packages/core/src/_typography.scss
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
// Copyright 2015 Palantir Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0.

@use "@blueprintjs/colors/lib/scss/colors" as *;
@use "common/variables" as *;
@use "common/variables-extended" as *;
@use "common/color-aliases" as *;
@use "common/mixins" as *;
@use "common/typography-colors" as *;
@use "components/icon/icon" as *;
@use "components/html-table/html-table" as *;
@import "common/variables";
@import "common/variables-extended";
@import "common/mixins";
@import "common/typography-colors";
@import "components/icon/icon";
@include pt-typography-colors();

/*
Expand Down
2 changes: 0 additions & 2 deletions packages/core/src/accessibility/_focus-states.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// Copyright 2016 Palantir Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0.
@use "../common/variables" as *;
@use "../common/mixins" as *;

:focus {
@include focus-outline();
Expand Down
15 changes: 10 additions & 5 deletions packages/core/src/blueprint.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ Licensed under the Apache License, Version 2.0.
*/

// Import files in the same order that they are documented in the docs
@forward "reset";
@forward "typography";
@forward "accessibility/focus-states";
@forward "dark-theme";
@forward "components/index";
@import "@blueprintjs/colors/lib/scss/colors";
@import "common/variables";
@import "common/variables-extended";
@import "common/mixins";

@import "reset";
@import "typography";
@import "accessibility/focus-states";
@import "dark-theme";
@import "components/index";
1 change: 0 additions & 1 deletion packages/core/src/common/_color-aliases.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
// - A limited subset of Sass syntax is supported. All syntax inluded here must be able to get parsed by the
// `generate-css-variables` script in @blueprintjs/node-build-scripts. For example, "sass:math" is unsupported.
// ----------------------------------------------------------------------------
@use "@blueprintjs/colors/lib/scss/colors" as *;

$pt-intent-primary: $blue3 !default;
$pt-intent-success: $green3 !default;
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/common/_flex.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2018 Palantir Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0.
@use "variables" as *;

// this element becomes a flex container in the given direction.
// supply `$margin` to put space between each child.
Expand Down
6 changes: 2 additions & 4 deletions packages/core/src/common/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
// Licensed under the Apache License, Version 2.0.

@use "sass:math";
@use "@blueprintjs/colors/lib/scss/colors" as *;
@use "color-aliases" as *;
@use "variables" as *;
@use "flex" as *;
@import "@blueprintjs/colors/lib/scss/colors";
@import "flex";

$pt-intent-colors: (
"primary": $pt-intent-primary,
Expand Down
2 changes: 0 additions & 2 deletions packages/core/src/common/_react-transition.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright 2016 Palantir Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0.

@use "variables" as *;

/*
A mixin to generate the classes for a React CSSTransition which animates any number of CSS
properties at once.
Expand Down
8 changes: 3 additions & 5 deletions packages/core/src/common/_typography-colors.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
// Copyright 2022 Palantir Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0.

@use "@blueprintjs/colors/lib/scss/colors" as *;
@use "variables" as *;
@use "variables-extended" as *;
@use "color-aliases" as *;
@use "mixins" as *;
@import "variables";
@import "variables-extended";
@import "mixins";

@mixin pt-typography-colors() {
// N.B. we can't declare any global colors here because this mixin is @included at
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/common/_variables-extended.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2022 Palantir Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0.

@use "variables" as *;
@import "variables";

// ----------------------------------------------------------------------------
// This file contains additional common variables which we do not want to export in public API via variables.scss,
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/common/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright 2015 Palantir Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0.

@use "@blueprintjs/colors/lib/scss/colors" as *;
@use "color-aliases" as *;
@import "color-aliases";
@import "mixins";

// ----------------------------------------------------------------------------
// This file is part of the public Sass API of @blueprintjs/core.
Expand Down
92 changes: 46 additions & 46 deletions packages/core/src/components/_index.scss
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
// Copyright 2015 Palantir Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0.

@forward "alert/alert";
@forward "breadcrumbs/breadcrumbs";
@forward "button/button";
@forward "button/button-group";
@forward "callout/callout";
@forward "card/card";
@forward "card-list/card-list";
@forward "collapse/collapse";
@forward "context-menu/context-menu";
@forward "control-card/control-card";
@forward "divider/divider";
@forward "dialog/dialog";
@forward "dialog/dialog-body";
@forward "dialog/dialog-footer";
@forward "dialog/multistep-dialog";
@forward "drawer/drawer";
@forward "editable-text/editable-text";
@forward "entity-title/entity-title";
@forward "forms/index";
@forward "html-select/html-select";
@forward "html-table/html-table";
@forward "hotkeys/hotkeys";
@forward "icon/icon";
@forward "menu/menu";
@forward "navbar/navbar";
@forward "non-ideal-state/non-ideal-state";
@forward "overflow-list/overflow-list";
@forward "overlay/overlay";
@forward "panel-stack/panel-stack";
@forward "panel-stack2/panel-stack2";
@forward "popover/popover";
@forward "portal/portal";
@forward "progress-bar/progress-bar";
@forward "section/section";
@forward "segmented-control/segmented-control";
@forward "skeleton/skeleton";
@forward "slider/slider";
@forward "spinner/spinner";
@forward "tabs/tabs";
@forward "tag/tag";
@forward "tag/compound-tag";
@forward "tag-input/tag-input";
@forward "tag-input/resizable-input";
@forward "toast/toast";
@forward "tooltip/tooltip";
@forward "tree/tree";
@import "alert/alert";
@import "breadcrumbs/breadcrumbs";
@import "button/button";
@import "button/button-group";
@import "callout/callout";
@import "card/card";
@import "card-list/card-list";
@import "collapse/collapse";
@import "context-menu/context-menu";
@import "control-card/control-card";
@import "divider/divider";
@import "dialog/dialog";
@import "dialog/dialog-body";
@import "dialog/dialog-footer";
@import "dialog/multistep-dialog";
@import "drawer/drawer";
@import "editable-text/editable-text";
@import "entity-title/entity-title";
@import "forms/index";
@import "html-select/html-select";
@import "html-table/html-table";
@import "hotkeys/hotkeys";
@import "icon/icon";
@import "menu/menu";
@import "navbar/navbar";
@import "non-ideal-state/non-ideal-state";
@import "overflow-list/overflow-list";
@import "overlay/overlay";
@import "panel-stack/panel-stack";
@import "panel-stack2/panel-stack2";
@import "popover/popover";
@import "portal/portal";
@import "progress-bar/progress-bar";
@import "section/section";
@import "segmented-control/segmented-control";
@import "skeleton/skeleton";
@import "slider/slider";
@import "spinner/spinner";
@import "tabs/tabs";
@import "tag/tag";
@import "tag/compound-tag";
@import "tag-input/tag-input";
@import "tag-input/resizable-input";
@import "toast/toast";
@import "tooltip/tooltip";
@import "tree/tree";
2 changes: 1 addition & 1 deletion packages/core/src/components/alert/_alert.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2016 Palantir Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0.

@use "../../common/variables" as *;
@import "../../common/variables";

.#{$ns}-alert {
max-width: $pt-grid-size * 40;
Expand Down
6 changes: 2 additions & 4 deletions packages/core/src/components/breadcrumbs/_breadcrumbs.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
// Copyright 2016 Palantir Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0.

@use "@blueprintjs/colors/lib/scss/colors" as *;
@use "@blueprintjs/icons/lib/scss/variables" as *;
@use "../../common/variables" as *;
@use "../../common/color-aliases" as *;
@import "@blueprintjs/icons/lib/scss/variables";
@import "../../common/variables";

/*
Breadcrumbs
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/components/button/_button-group.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright 2015 Palantir Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0.

@use "../../common/variables" as *;
@use "../forms/common" as *;
@use "./common" as *;
@import "../../common/variables";
@import "../forms/common";
@import "./common";

/*
Button groups
Expand Down
10 changes: 3 additions & 7 deletions packages/core/src/components/button/_button.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
// Copyright 2015 Palantir Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0.

@use "@blueprintjs/colors/lib/scss/colors" as *;
@use "../../common/color-aliases" as *;
@use "../../common/variables" as *;
@use "../../common/variables-extended" as *;
@use "./common" as *;
@use "../icon/icon-mixins" as *;
@use "../progress-bar/common" as *;
@import "../../common/variables";
@import "../../common/variables-extended";
@import "./common";

/*
Button
Expand Down
11 changes: 4 additions & 7 deletions packages/core/src/components/button/_common.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
// Copyright 2015 Palantir Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0.

@use "@blueprintjs/colors/lib/scss/colors" as *;
@use "../../common/color-aliases" as *;
@use "../../common/flex" as *;
@use "../../common/mixins" as *;
@use "../../common/variables" as *;
@use "../../common/variables-extended" as *;
@use "../progress-bar/common" as *;
@import "../../common/mixins";
@import "../../common/variables";
@import "../../common/variables-extended";
@import "../progress-bar/common";

$button-border-width: 1px !default;
$button-padding: ($pt-grid-size * 0.5) $pt-grid-size !default;
Expand Down
7 changes: 1 addition & 6 deletions packages/core/src/components/callout/_callout.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
// Copyright 2015 Palantir Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0.

@use "@blueprintjs/colors/lib/scss/colors" as *;
@use "../../common/color-aliases" as *;
@use "../../common/variables" as *;
@use "../../common/variables-extended" as *;
@use "../../common/mixins" as *;
@use "../icon/icon-mixins" as *;
@import "../../common/variables-extended";

/*
Callout
Expand Down
5 changes: 1 addition & 4 deletions packages/core/src/components/card-list/card-list.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
// Copyright 2023 Palantir Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0.

@use "@blueprintjs/colors/lib/scss/colors" as *;
@use "../../common/color-aliases" as *;
@use "../../common/variables" as *;
@use "../card/card-variables" as *;
@import "../card/card-variables";

.#{$ns}-card-list {
overflow: auto;
Expand Down
5 changes: 1 addition & 4 deletions packages/core/src/components/card/_card-variables.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
// Copyright 2023 Palantir Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0.

@use "@blueprintjs/colors/lib/scss/colors" as *;
@use "../../common/color-aliases" as *;
@use "../../common/variables" as *;
@use "../../common/variables-extended" as *;
@import "../../common/variables-extended";

$card-padding: $pt-grid-size * 2 !default;
$card-padding-compact: $pt-grid-size * 1.5 !default;
Expand Down
5 changes: 1 addition & 4 deletions packages/core/src/components/card/_card.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
// Copyright 2015 Palantir Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0.

@use "@blueprintjs/colors/lib/scss/colors" as *;
@use "../../common/variables" as *;
@use "../../common/variables-extended" as *;
@use "./card-variables" as *;
@import "./card-variables";

/*
Cards
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/components/collapse/_collapse.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2016 Palantir Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0.

@use "../../common/variables" as *;
@import "../../common/variables";

$collapse-transition: ($pt-transition-duration * 2) $pt-transition-ease !default;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2021 Palantir Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0.

@use "../../common/variables" as *;
@import "../../common/variables";

.#{$ns}-context-menu-virtual-target {
position: fixed;
Expand Down
3 changes: 1 addition & 2 deletions packages/core/src/components/control-card/_control-card.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// Copyright 2023 Palantir Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0.

@use "../../common/variables" as *;
@use "../card/card-variables" as *;
@import "../card/card-variables";

// use an extra selector to increase specificity
.#{$ns}-card.#{$ns}-control-card {
Expand Down
Loading

1 comment on commit 762c04f

@svc-palantir-github
Copy link

Choose a reason for hiding this comment

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

Revert "Switch from @import to @use (#7074)"

Build artifact links for this commit: documentation | landing | table | demo

This is an automated comment from the deploy-preview CircleCI job.

Please sign in to comment.