@triptease/tt-navbar 0.0.26 → 0.0.28

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @triptease/tt-navbar v0.0.26
2
+ * @triptease/tt-navbar v0.0.28
3
3
  */
4
4
 
5
5
  // src/urlMappings.ts
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Webcomponent tt-navbar following open-wc recommendations",
4
4
  "license": "MIT",
5
5
  "author": "tt-navbar",
6
- "version": "0.0.26",
6
+ "version": "0.0.28",
7
7
  "type": "module",
8
8
  "main": "dist/src/index.js",
9
9
  "module": "dist/src/index.js",
package/src/TtNavbar.ts CHANGED
@@ -66,6 +66,18 @@ export class TtNavbar extends LitElement {
66
66
  this.setActiveState();
67
67
  }
68
68
 
69
+ public connectedCallback() {
70
+
71
+ window.addEventListener('popstate', this.setActiveState);
72
+ super.connectedCallback();
73
+ }
74
+
75
+ public disconnectedCallback() {
76
+
77
+ window.removeEventListener('popstate', this.setActiveState);
78
+ super.disconnectedCallback();
79
+ }
80
+
69
81
  /*
70
82
  * Set the active state for the current page.
71
83
  *
package/src/styles.ts CHANGED
@@ -195,6 +195,13 @@ export const styles = css`
195
195
  }
196
196
  }
197
197
 
198
+ .sidebar-closed details:has(.current-page) > summary {
199
+ --nav-item-color: var(--color-primary-400);
200
+ border-radius: var(--border-radius-100);
201
+ background-color: var(--color-primary-100);
202
+ color: var(--nav-item-color);
203
+ }
204
+
198
205
  .sub-nav-item {
199
206
  width: 100%;
200
207
  display: flex;
@@ -226,8 +233,7 @@ export const styles = css`
226
233
  }
227
234
  }
228
235
 
229
- .current-page,
230
- .sidebar-closed details:has(.current-page) > summary {
236
+ .current-page {
231
237
  --nav-item-color: var(--color-primary-400);
232
238
  border-radius: var(--border-radius-100);
233
239
  background-color: var(--color-primary-100);