@solexllc/usx 0.1.3 → 0.1.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solexllc/usx",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "Compiled USWDS-based component styles for USX.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -32,7 +32,7 @@
32
32
  "src"
33
33
  ],
34
34
  "dependencies": {
35
- "@solexllc/usx-theme": "0.2.0"
35
+ "@solexllc/usx-theme": "0.2.1"
36
36
  },
37
37
  "devDependencies": {
38
38
  "sass": "^1.98.0"
@@ -44,20 +44,6 @@
44
44
  overflow: unset;
45
45
  }
46
46
 
47
- .usx-nav {
48
- @media (width < 64em) {
49
- @if $usx-header-nav-bg-mobile {
50
- background-color: $usx-header-nav-bg-mobile;
51
- }
52
- }
53
-
54
- @media (width >=64em) {
55
- @if $usx-header-nav-bg {
56
- background-color: $usx-header-nav-bg;
57
- }
58
- }
59
- }
60
-
61
47
  // Keeps utilityContent and the search box on one row regardless of the
62
48
  // parent's own flex-direction (USWDS's .usa-nav__secondary stacks its
63
49
  // children in a column at desktop).
@@ -69,15 +55,32 @@
69
55
 
70
56
  }
71
57
 
72
- :has(> .usa-header--extended) {
73
- // Background is themeable at every width — unlike vendor (which paints no
74
- // background at desktop and a hardcoded opaque white at mobile), USX lets a
75
- // theme's configured nav color show through the mobile drawer too, so a
76
- // dark theme's drawer doesn't revert to an unstyled white panel. Desktop
77
- // and mobile can be themed independently since the drawer and the nav bar
78
- // are visually distinct surfaces.
58
+ // .usx-nav is two different surfaces depending on width. Below 64em it is the
59
+ // off-canvas drawer in EVERY layout — vendor paints it a hardcoded opaque
60
+ // white, so a dark theme's drawer would otherwise revert to an unstyled white
61
+ // panel. At desktop it's only a distinct surface in the extended layout (a
62
+ // full-width bar under the header); the basic layout's nav sits inline in the
63
+ // header bar and must inherit the header background instead.
64
+ //
65
+ // The extended layout renders <header> and <nav> as siblings (see
66
+ // Header.tsx), so neither rule can be nested under .usx-header.
67
+ .usx-nav {
68
+ @media (width < 64em) {
69
+ @if $usx-header-nav-bg-mobile {
70
+ background-color: $usx-header-nav-bg-mobile;
71
+ }
72
+ }
73
+ }
79
74
 
75
+ :has(> .usa-header--extended) .usx-nav {
76
+ @media (width >=64em) {
77
+ @if $usx-header-nav-bg {
78
+ background-color: $usx-header-nav-bg;
79
+ }
80
+ }
81
+ }
80
82
 
83
+ :has(> .usa-header--extended) {
81
84
  // USWDS scopes all of its own .usa-header--extended .usa-nav(__inner) and
82
85
  // hover/current-bar rules to this same desktop breakpoint (the nav is an
83
86
  // off-canvas mobile drawer below it, styled by vendor's plain .usa-nav