Skip to content

Commit f408d37

Browse files
authored
fix: inline blueprint sass (#199)
* chore: inline the blueprintjs sass files pulled from node_modules as-is * fix: small changes to make blueprint work w sass * oops * run sass-migrator division
1 parent 8134d01 commit f408d37

73 files changed

Lines changed: 8259 additions & 5 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/styles/_blueprint.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
@import 'blueprint/variables';
66

7-
@import '~@blueprintjs/core/src/typography';
8-
@import '~@blueprintjs/core/src/accessibility/focus-states';
7+
@import './blueprint/src/typography';
8+
@import './blueprint/src/accessibility/focus-states';
99

10-
@import '~@blueprintjs/core/src/components/index';
10+
@import './blueprint/src/components/index';
1111

1212
/**
1313
* BLUEPRINT SELECT
1414
*/
1515

16-
@import '~@blueprintjs/select/src/blueprint-select.scss';
16+
@import './blueprint/select/blueprint-select.scss';

src/styles/blueprint/_variables.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use "sass:math";
2+
13
@import "colors";
24

35
@import '~@blueprintjs/core/src/common/_mixins.scss';
@@ -25,7 +27,7 @@ $pt-font-size-large: get-font-size(lg);
2527
$pt-font-size-small: get-font-size(sm);
2628

2729
// a little bit extra to ensure the height comes out to just over 18px (and browser rounds to 18px)
28-
$pt-line-height: ($pt-grid-size * 1.8) / $pt-font-size + 0.0001 !default;
30+
$pt-line-height: math.div($pt-grid-size * 1.8, $pt-font-size) + 0.0001 !default;
2931

3032
// Icon variables
3133

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*
2+
3+
Copyright 2017-present Palantir Technologies, Inc. All rights reserved.
4+
Licensed under the Apache License, Version 2.0.
5+
6+
*/
7+
8+
@import "./components/index";
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Copyright 2017 Palantir Technologies, Inc. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0.
3+
4+
@import "omnibar/omnibar";
5+
@import "select/multi-select";
6+
@import "select/select";
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// Copyright 2017 Palantir Technologies, Inc. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0.
3+
4+
@import "~@blueprintjs/core/src/common/react-transition";
5+
@import "~@blueprintjs/core/src/common/variables";
6+
7+
$omnibar-height: 60vh !default;
8+
$omnibar-width: $pt-grid-size * 50 !default;
9+
$omnibar-input-height: $pt-grid-size * 4;
10+
11+
.#{$ns}-omnibar {
12+
$omnibar-transition-props: (
13+
filter: (blur($pt-grid-size * 2), blur(0)),
14+
opacity: (0.2, 1),
15+
);
16+
17+
@include react-transition(
18+
"#{$ns}-overlay",
19+
$omnibar-transition-props,
20+
$duration: $pt-transition-duration * 2,
21+
$easing: $pt-transition-ease,
22+
$before: "&"
23+
);
24+
background-color: $white;
25+
border-radius: $pt-border-radius;
26+
box-shadow: $pt-elevation-shadow-4;
27+
left: calc(50% - #{$omnibar-width * 0.5});
28+
top: (100 - $omnibar-height) * 0.5;
29+
width: $omnibar-width;
30+
z-index: $pt-z-index-overlay + 1;
31+
32+
.#{$ns}-input {
33+
background-color: transparent;
34+
border-radius: 0;
35+
36+
&,
37+
&:focus {
38+
box-shadow: none;
39+
}
40+
}
41+
42+
.#{$ns}-menu {
43+
background-color: transparent;
44+
border-radius: 0;
45+
box-shadow: inset 0 1px 0 $pt-divider-black;
46+
max-height: calc(#{$omnibar-height} - #{$omnibar-input-height});
47+
overflow: auto;
48+
49+
&:empty {
50+
display: none;
51+
}
52+
}
53+
54+
.#{$ns}-dark &,
55+
&.#{$ns}-dark {
56+
background-color: $dark-gray4;
57+
box-shadow: $pt-dark-elevation-shadow-4;
58+
}
59+
}
60+
61+
.#{$ns}-omnibar-overlay .#{$ns}-overlay-backdrop {
62+
background-color: rgba($black, 0.2);
63+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2017 Palantir Technologies, Inc. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0.
3+
4+
@import "~@blueprintjs/core/src/common/variables";
5+
@import "../select/select";
6+
7+
.#{$ns}-multi-select {
8+
min-width: $pt-grid-size * 15;
9+
}
10+
11+
.#{$ns}-multi-select-popover {
12+
.#{$ns}-menu {
13+
max-height: $select-popover-max-height;
14+
max-width: $select-popover-max-width;
15+
overflow: auto;
16+
}
17+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright 2017 Palantir Technologies, Inc. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0.
3+
4+
@import "~@blueprintjs/core/src/common/variables";
5+
6+
$select-popover-max-height: $pt-grid-size * 30 !default;
7+
$select-popover-max-width: $pt-grid-size * 40 !default;
8+
9+
.#{$ns}-select-popover {
10+
.#{$ns}-popover-content {
11+
// use padding on container rather than margin on input group
12+
// because top margin leaves some empty space with no background color.
13+
padding: $pt-grid-size * 0.5;
14+
}
15+
16+
.#{$ns}-input-group {
17+
margin-bottom: 0;
18+
}
19+
20+
.#{$ns}-menu {
21+
max-height: $select-popover-max-height;
22+
max-width: $select-popover-max-width;
23+
overflow: auto;
24+
padding: 0;
25+
26+
&:not(:first-child) {
27+
// adjust padding to account for that on .#{$ns}-popover-content above
28+
padding-top: $pt-grid-size * 0.5;
29+
}
30+
}
31+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Copyright 2015 Palantir Technologies, Inc. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0.
3+
4+
@import "common/variables";
5+
@import "common/mixins";
6+
7+
// Apply a natural box layout model to all elements, but allow components to change as necessary
8+
html {
9+
box-sizing: border-box;
10+
}
11+
12+
// adjust box-sizing for every element ever
13+
*,
14+
*::before,
15+
*::after {
16+
box-sizing: inherit;
17+
}
18+
19+
// Style resets on top of Normalize.css
20+
21+
body {
22+
@include base-typography();
23+
color: $pt-text-color;
24+
font-family: $pt-font-family;
25+
}
26+
27+
p {
28+
margin-bottom: $pt-grid-size;
29+
margin-top: 0;
30+
}
31+
32+
small {
33+
font-size: $pt-font-size-small;
34+
}
35+
36+
strong {
37+
font-weight: 600;
38+
}
39+
40+
// consistent cross-browser text selection
41+
::selection {
42+
background: $pt-text-selection-color;
43+
}

0 commit comments

Comments
 (0)