@wwtdev/bsds-css 3.2.1 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,108 +1,3 @@
1
1
  # BSDS CSS Framework
2
2
 
3
- ## Installation
4
-
5
- ```bash
6
- npm install --save @wwtdev/bsds-css
7
- ```
8
-
9
- You can import the minified stylesheet in your project's `main.js` like so:
10
-
11
- ```javascript
12
- import '@wwtdev/bsds-css/dist/wwt-bsds.min.css'
13
- ```
14
-
15
- ## Using with Tailwind CSS
16
-
17
- If your project uses Tailwind, complete the steps above and then [install Tailwind](https://tailwindcss.com/docs/installation) if you haven't already. You can follow the instructions in their docs with the exceptions listed below
18
-
19
- ### 1. Add the WWT Preset to the Tailwind config.
20
-
21
- For new projects, we recommend that you use the provided config file as a [**preset**](https://tailwindcss.com/docs/presets). When setting up the `tailwind.config.js` file, import the WWT preset from the CSS Framework package. Note that `wwt-bsds-preset.js` sets `config.corePlugins.preflight: false` by default; we do this to apply our style resets instead of the Tailwind resets.
22
-
23
- ```javascript
24
- /* tailwind.config.js */
25
-
26
- module.exports = {
27
- presets: [require('@wwtdev/bsds-css/dist/wwt-bsds-preset.js')]
28
- };
29
- ```
30
-
31
- While the foregoing setup is our recommended method, we have still put in effort to ensure that `wwt-bsds-preset.js` works as a [**base configuration**](https://tailwindcss.com/docs/configuration) in conjunction with the tailwind defaults and reset as well. So this _should_ still work as an alternative if needed, though it is not the focus/priority of our project:
32
-
33
- ```javascript
34
- /* tailwind.config.js */
35
-
36
- const wwtConfig = require('@wwtdev/bsds-css/dist/wwt-bsds-preset.js')
37
- module.exports = {
38
- ...wwtConfig,
39
- corePlugins: { preflight: false }
40
- };
41
- ```
42
-
43
-
44
- ### 2. Tailwind CSS Directives
45
-
46
- To prevent conflicts with our CSS Framework, only include the `base` and `utilities` directives.
47
-
48
- Since our CSS has its own reset and default styles, we prevent Tailwind's `base` reset styles from loading, via a setting in our WWT Preset. The only styles that will be used from `base` are Tailwind CSS variables, which are needed in order to ensure all Tailwind classes work as expected.
49
-
50
- ```css
51
- /* src/styles/tailwind.css */
52
-
53
- @tailwind base;
54
- @tailwind utilities;
55
- ```
56
-
57
- Once you have completed the Tailwind installation steps, you can use the classes generated from the preset.
58
-
59
- #### Order matters!
60
-
61
- In your project's stylesheet ordering, the BSDS CSS framework should come first, _then_ the base Tailwind styles for easier overriding via TW utilities.
62
-
63
- ```javascript
64
- /* src/main.js */
65
-
66
-
67
- // Blue Steel Styles
68
- import '@wwtdev/bsds-css/dist/wwt-bsds.min.css'
69
- // TW
70
- import './styles/tailwind.css'
71
-
72
- ```
73
-
74
- Alternatively, you can leverage native CSS `@layer` to ensure TW utilities will always trump these styles.
75
-
76
- ```css
77
- /* src/styles/index.css (or wherever your styles live) */
78
-
79
- @layer app-base, external, app, utils;
80
-
81
- /* -- BASE -- */
82
- @import "@wwtdev/bsds-css/dist/wwt-bsds.min.css" layer(app-base);
83
-
84
- /* -- EXTERNAL: any external stylesheets, e.g. from other 3d party libs -- */
85
- @import "some-other-pkg/dist/style.css" layer(external);
86
-
87
- /* -- APP / INTERNAL STYLES, e.g. your site's base styles -- */
88
- @import "some-content.css" layer(app);
89
-
90
- /* -- UTILITY CLASSES --
91
- Due to how native CSS @layer works, and our defined layer order at the top of this file, utility classes will always trump any other styles in the app (as long as those styles are in one of our defined layers)
92
- */
93
-
94
- @layer utils {
95
- @tailwind base;
96
- @tailwind utilities;
97
- }
98
-
99
- ```
100
-
101
- ### 3. Dark Mode-compatible "semantic" color utilities
102
-
103
- We've extended the TW theme with color utilities that will automatically adjust when using dark mode. These classes require the CSS custom properties defined in the global stylesheet (`wwt-bsds.css`). If you're not bringing that stylesheet in, either disregard these classes or manually include the properties from [tokens.css](https://github.com/wwt-custom-apps/wwt-blue-steel/blob/main/packages/css-framework/src/styles/tokens.css) and [global.css](https://github.com/wwt-custom-apps/wwt-blue-steel/blob/main/packages/css-framework/src/styles/global.css) in your project.
104
-
105
-
106
- ### Browser Support
107
-
108
- Our styles are compiled using Post CSS and Autoprefixer using the [`defaults` setting](https://github.com/browserslist/browserslist#full-list).
3
+ CSS framework for the [Blue Steel Design System](https://design.apps.wwt.com), built and maintained by [WWT](https://www.wwt.com). Provides design tokens, CSS components, utilities, and a Tailwind CSS preset that implement WWT's brand design language.
@@ -848,10 +848,10 @@ Custom properties:
848
848
  }
849
849
  /* Negative Toast Styles */
850
850
  .bs-toast-deprecated:where([data-variant^='negative']) {
851
- border-top: 4px solid var(--bs-negative-dark);
851
+ border-top: 4px solid var(--bs-negative-base);
852
852
  }
853
853
  .bs-toast-deprecated:where([data-variant^='negative']) :where(.bs-toast-header-deprecated .bs-toast-header-deprecated-icon) {
854
- color: var(--bs-negative-dark);
854
+ color: var(--bs-negative-base);
855
855
  }
856
856
  @media (min-width: 440px) {
857
857
  .bs-toast-deprecated {
@@ -1073,15 +1073,13 @@ This must go last to properly override the other classes
1073
1073
  transform: translateY(-50%) scale(0.5);
1074
1074
  }
1075
1075
  .bs-accordion {
1076
- --accordion-link-color: var(--bs-positive-base-fixed);
1077
- --accordion-link-outline-color: var(--bs-primary-base);
1078
1076
  --accordion-outline-color: transparent;
1079
1077
  --accordion-padding-inline: 0;
1080
1078
  --accordion-text-size: var(--bs-text-sm);
1081
1079
  border-block: 1px solid var(--bs-border-base);
1082
1080
  display: block;
1083
1081
  }
1084
- @media (min-width: 957px) {
1082
+ @media (min-width: 752px) {
1085
1083
  .bs-accordion {
1086
1084
  --accordion-padding-inline: var(--bs-space-2);
1087
1085
  --accordion-text-size: var(--bs-text-base);
@@ -1129,7 +1127,7 @@ This must go last to properly override the other classes
1129
1127
  .bs-accordion > :where(header) > :where(button) > * {
1130
1128
  vertical-align: middle;
1131
1129
  }
1132
- @media (min-width: 957px) {
1130
+ @media (min-width: 752px) {
1133
1131
  .bs-accordion :where(.bs-accordion-toggle) > * ,
1134
1132
  .bs-accordion > :where(header) > :where(button) > * {
1135
1133
  margin-right: var(--bs-space-3);
@@ -1167,7 +1165,7 @@ This must go last to properly override the other classes
1167
1165
  }
1168
1166
  .bs-accordion :where(.bs-accordion-content[data-open]:not([data-open="false"])) {
1169
1167
  grid-template-rows: 1fr;
1170
- padding-block-end: var(--bs-space-f-2);
1168
+ padding-block-end: var(--bs-space-2);
1171
1169
  }
1172
1170
  /* Accordion Group */
1173
1171
  :where(.bs-accordion[data-stacked]:not([data-stacked="false"])) + .bs-accordion:where([data-stacked]:not([data-stacked="false"])) {
@@ -1199,7 +1197,7 @@ This must go last to properly override the other classes
1199
1197
  .bs-alert:where([data-horizontal="true"]) {
1200
1198
  padding: 1rem 1.5rem;
1201
1199
  grid-template-areas: "icon title action close";
1202
- grid-template-columns: 1.125rem max-content 1fr 1rem;
1200
+ grid-template-columns: 1.125rem auto 1fr 1rem;
1203
1201
  }
1204
1202
  }
1205
1203
  .bs-alert :where(.bs-alert-icon) {
@@ -1225,6 +1223,7 @@ This must go last to properly override the other classes
1225
1223
  .bs-alert:where([data-horizontal="true"]) :where(.bs-alert-title) {
1226
1224
  font-size: 1.125rem;
1227
1225
  line-height: 1.5;
1226
+ overflow-wrap: break-word;
1228
1227
  }
1229
1228
 
1230
1229
  .bs-alert:where(:not([data-horizontal="true"])) :where(.bs-alert-icon) {
@@ -1265,6 +1264,7 @@ This must go last to properly override the other classes
1265
1264
  .bs-alert :where(.bs-alert-action) {
1266
1265
  grid-area: action;
1267
1266
  margin-top: 1rem;
1267
+ white-space: nowrap;
1268
1268
  }
1269
1269
  @media (min-width: 752px) {
1270
1270
  .bs-alert:where([data-horizontal="true"]) :where(.bs-alert-action) {
@@ -1447,7 +1447,7 @@ This must go last to properly override the other classes
1447
1447
  .bs-banner:where([data-variant="negative"]) {
1448
1448
  --banner-bg: var(--bs-accent-6-medium);
1449
1449
  }
1450
- @media (min-width: 957px) {
1450
+ @media (min-width: 752px) {
1451
1451
  .bs-banner {
1452
1452
  --banner-icon-display: inline-flex;
1453
1453
  --banner-padding: var(--banner-padding-dt);
@@ -1994,8 +1994,8 @@ a.bs-circle-button {
1994
1994
  .bs-circle-button:where([data-ghost]:not([data-ghost="false"])) {
1995
1995
  --btn-icon-bg-color: transparent;
1996
1996
  --btn-icon-stroke-color: var(--btn-main);
1997
- --btn-light: var(--bs-primary-10);
1998
- --btn-secondary: var(--bs-primary-10);
1997
+ --btn-light: transparent;
1998
+ --btn-secondary: transparent;
1999
1999
  }
2000
2000
  /* Active, Hover, Focus states */
2001
2001
  .bs-circle-button:active, .bs-circle-button:hover {
@@ -3831,7 +3831,7 @@ label:where(.bs-label) {
3831
3831
  .bs-option:where(:not([data-multiple="true"])[aria-selected="true"]) {
3832
3832
  --description-color: var(--bs-ink-primary);
3833
3833
  background: var(--bs-bg-medium-to-light);
3834
- border-left-color: var(--bs-ink-primary);
3834
+ border-left-color: var(--bs-primary-base);
3835
3835
  color: var(--bs-ink-primary);
3836
3836
  }
3837
3837
  /* selected yet disabled...should be a very rare scenario, but need to handle it */
@@ -4015,8 +4015,9 @@ label:where(.bs-label) {
4015
4015
  font-family: inherit;
4016
4016
  font-size: var(--bs-text-sm);
4017
4017
  gap: var(--pill-gap);
4018
- height: 1.5rem;
4019
4018
  line-height: 1rem;
4019
+ max-width: 100%;
4020
+ min-height: var(--bs-pill-height);
4020
4021
  padding: 0 .375rem;
4021
4022
  position: relative;
4022
4023
  text-decoration: none;
@@ -4188,6 +4189,23 @@ label:where(.bs-label) {
4188
4189
  .bs-pill:where([data-variant^="filter"])[data-active="false"]:is(:disabled, [aria-disabled="true"]) {
4189
4190
  --pill-border: var(--bs-gray-400);
4190
4191
  }
4192
+ .bs-pill-group {
4193
+ --pill-group-max-lines: 3;
4194
+ }
4195
+ .bs-pill-group-pills {
4196
+ /* Mainly for css-component-only usage */
4197
+ --default-max-height: calc(var(--pill-group-max-lines) * (var(--bs-pill-height) + var(--bs-space-2)));
4198
+ display: flex;
4199
+ flex-wrap: wrap;
4200
+ gap: var(--bs-space-2);
4201
+ max-height: var(--pill-group-max-height, var(--default-max-height));
4202
+ overflow: hidden;
4203
+ }
4204
+ .bs-pill-group-pills:where([data-expanded="true"]) {
4205
+ margin-bottom: var(--bs-space-2);
4206
+ max-height: none;
4207
+ overflow: visible;
4208
+ }
4191
4209
  .bs-profile-details {
4192
4210
  color: var(--bs-ink-light);
4193
4211
  font-size: var(--bs-text-sm);
@@ -4359,14 +4377,14 @@ a.bs-profile:where([data-layout]):hover {
4359
4377
  --bs-spinner-color-1: white;
4360
4378
  --bs-spinner-color-2: white;
4361
4379
  }
4362
- :where(#bs-spinner-gradient stop) {
4380
+ .bs-spinner:where([data-variant="gradient"]) :where(linearGradient stop) {
4363
4381
  stop-color: var(--bs-secondary-base-fixed);
4364
4382
  }
4365
- :where(#bs-spinner-gradient stop:first-child) {
4383
+ .bs-spinner:where([data-variant="gradient"]) :where(linearGradient stop:first-child) {
4366
4384
  stop-color: var(--bs-primary-base-fixed);
4367
4385
  }
4368
- :where(#bs-spinner-gradient stop:last-child) {
4369
- stop-color: var(--bs-negative-dark);
4386
+ .bs-spinner:where([data-variant="gradient"]) :where(linearGradient stop:last-child) {
4387
+ stop-color: var(--bs-negative-base);
4370
4388
  }
4371
4389
  @keyframes bs-spin {
4372
4390
  0% {
@@ -5942,65 +5960,90 @@ a.bs-text-button {
5942
5960
  --bs-pop-header-padding: var(--bs-space-6);
5943
5961
  --bs-pop-body-padding: var(--bs-space-6);
5944
5962
  --bs-pop-footer-padding: var(--bs-space-6);
5945
- margin: 0;
5963
+ --bs-popover-height: 100dvh;
5964
+ --bs-popover-width: 100dvw;
5946
5965
  border-radius: 0;
5966
+ margin: 0;
5967
+ max-height: unset;
5968
+ max-width: 100dvw;
5969
+
5970
+ /* -- SHADOWS -- */
5971
+ &:where([data-place-self="left"]) {
5972
+ box-shadow: var(--bs-shadow-drawerRight);
5973
+ }
5974
+
5975
+ &:where([data-place-self="right"]) {
5976
+ box-shadow: var(--bs-shadow-drawerLeft);
5977
+ }
5978
+
5979
+ /* -- RESIZING -- */
5980
+ &:where([data-resize]) {
5981
+ /* using clip instead of hidden, to allow resizer hover target
5982
+ to extend outside of the flyout bounds via overflow-clip-margin */
5983
+ overflow: clip;
5984
+ }
5985
+
5986
+ /* right flyout */
5987
+ &:where([data-resize="right"]) {
5988
+ overflow-clip-margin: 5px;
5989
+ }
5990
+
5991
+ /* left flyout - not using same as right flyout, to avoid overlapping potential scrollbar too much */
5992
+ &:where([data-resize="left"]) {
5993
+ overflow-clip-margin: 7px;
5994
+ }
5995
+
5996
+ /*
5997
+ Everything below is desktop-only. Sizing and resize values are gated to
5998
+ widths above the mobile breakpoint, so at mobile widths the flyout falls
5999
+ back to the full-screen defaults above with no JS cleanup needed. The
6000
+ resizer writes its values to the --bs-flyout-resize-* custom properties.
6001
+ */
6002
+ @media (min-width: 752px) {
6003
+ &:where([data-size="sm"]) {
6004
+ --bs-popover-width: 22.5rem; /* 360px */
6005
+ }
6006
+
6007
+ &:where([data-size="md"]) {
6008
+ --bs-popover-width: 28.75rem; /* 460px */
6009
+ }
6010
+
6011
+ &:where([data-size="lg"]) {
6012
+ --bs-popover-width: 33.4375rem; /* 535px */
6013
+ }
6014
+
6015
+ &:where([data-size="fit-content"]) {
6016
+ --bs-popover-width: fit-content;
6017
+ }
6018
+
6019
+ &:where([data-resize]) {
6020
+ max-width: var(--bs-flyout-resize-max);
6021
+ min-width: var(--bs-flyout-resize-min);
6022
+ transform: translateX(var(--bs-flyout-resize-pushed, 0px));
6023
+ width: var(--bs-flyout-resize-width, var(--bs-popover-width));
6024
+ }
6025
+ }
5947
6026
  }
5948
6027
  /* targeting header too, so consumer could just do: <BsPopHeader>My Title</BsPopHeader> */
5949
6028
  .bs-flyout :where(.bs-pop-header, .bs-pop-title) {
5950
6029
  font-size: var(--bs-text-lg);
5951
6030
  }
5952
- /* -- SIZING -- */
5953
- .bs-flyout {
5954
- --bs-popover-height: 100dvh;
5955
- max-height: unset;
5956
- max-width: 100dvw;
5957
- }
5958
- .bs-flyout:where([data-size="sm"]) {
5959
- --bs-popover-width: 22.5rem; /* 360px */
5960
- }
5961
- .bs-flyout:where([data-size="md"]) {
5962
- --bs-popover-width: 28.75rem; /* 460px */
5963
- }
5964
- .bs-flyout:where([data-size="lg"]) {
5965
- --bs-popover-width: 33.4375rem; /* 535px */
5966
- }
5967
- /* -- RESIZING -- */
5968
- .bs-flyout:where([data-resize]) {
5969
- /* using clip instead of hidden, to allow resizer hover target
5970
- to extend outside of the flyout bounds via overflow-clip-margin */
5971
- overflow: clip;
5972
- transform: translateX(var(--bs-flyout-resize-pushed, 0px));
5973
- }
6031
+ /* -- RESIZER -- */
5974
6032
  .bs-flyout-resizer {
5975
6033
  cursor: col-resize;
5976
6034
  inset-block: 0;
5977
6035
  position: absolute;
5978
- width: 10px;
5979
- z-index: 1;
5980
6036
  /* prevents browser from trying to hijack touch interactions to handle on its own */
5981
6037
  touch-action: none;
5982
- }
5983
- /* right flyout */
5984
- .bs-flyout:where([data-resize="right"]) {
5985
- overflow-clip-margin: 5px;
6038
+ width: 10px;
6039
+ z-index: 1;
5986
6040
  }
5987
6041
  .bs-flyout:where([data-resize="right"]) :where(.bs-flyout-resizer) {
5988
6042
  left: -5px;
5989
6043
  }
5990
- /* left flyout - not using same as right flyout, to avoid overlapping potential scrollbar too much */
5991
- .bs-flyout:where([data-resize="left"]) {
5992
- overflow-clip-margin: 7px;
5993
- }
5994
6044
  .bs-flyout:where([data-resize="left"]) :where(.bs-flyout-resizer) {
5995
6045
  right: -7px;
5996
6046
  }
5997
- /* -- SHADOWS -- */
5998
- .bs-flyout:where([data-place-self="left"]) {
5999
- box-shadow: var(--bs-shadow-drawerRight);
6000
- }
6001
- .bs-flyout:where([data-place-self="right"]) {
6002
- box-shadow: var(--bs-shadow-drawerLeft);
6003
- }
6004
6047
  /* -- TRANSITIONS -- */
6005
6048
  .bs-flyout-enter-active,
6006
6049
  .bs-flyout-leave-active {
@@ -6011,18 +6054,27 @@ a.bs-text-button {
6011
6054
  }
6012
6055
  .bs-flyout-enter-active .bs-flyout,
6013
6056
  .bs-flyout-leave-active .bs-flyout {
6014
- transition-property: transform;
6015
6057
  transition-duration: var(--bs-popover-transition-duration);
6058
+ transition-property: transform;
6016
6059
  transition-timing-function: var(--bs-transition-cubic);
6017
6060
  }
6018
6061
  /* The 105% is so the huge shadow on the flyout ends-up off-screen too, otherwise at 100%, you notice it cut out when the panel closes */
6019
6062
  .bs-flyout-enter-from .bs-flyout[data-place-self="left"],
6020
6063
  .bs-flyout-leave-to .bs-flyout[data-place-self="left"] {
6021
- transform: translate(calc(-105% + var(--bs-flyout-resize-pushed, 0px)));
6064
+ transform: translate(-105%);
6065
+
6066
+ /* preserve any resize push offset while sliding in/out (desktop-only, matching the resize sizing above) */
6067
+ @media (min-width: 752px) {
6068
+ transform: translate(calc(-105% + var(--bs-flyout-resize-pushed, 0px)));
6069
+ }
6022
6070
  }
6023
6071
  .bs-flyout-enter-from .bs-flyout[data-place-self="right"],
6024
6072
  .bs-flyout-leave-to .bs-flyout[data-place-self="right"] {
6025
- transform: translate(calc(105% + var(--bs-flyout-resize-pushed, 0px)));
6073
+ transform: translate(105%);
6074
+
6075
+ @media (min-width: 752px) {
6076
+ transform: translate(calc(105% + var(--bs-flyout-resize-pushed, 0px)));
6077
+ }
6026
6078
  }
6027
6079
  /*
6028
6080
  HEADS-UP: