@kth/style 0.18.3 → 0.18.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.
@@ -0,0 +1,37 @@
1
+ 'use strict';
2
+
3
+ /* eslint no-var: off */
4
+ // JavaScript that originally was placed in kth-style
5
+ // It copies the content of the main menu and places it in the left mobile
6
+ window.addEventListener("load", () => {
7
+ // If no mobile menu container is present, skip everything
8
+ if (!document.getElementById("mobileMenuList")) {
9
+ return;
10
+ }
11
+ var mainMenu = document.getElementById("mainMenu"); // Get main menu
12
+ if (mainMenu) {
13
+ // For main menu items, copy a link if it exists, otherwise copy the link content
14
+ createMobileMenuItems(mainMenu.querySelectorAll("li"), true);
15
+ }
16
+ function createMobileMenuItems(menuItems, includeInline) {
17
+ for (var i = 0; i < menuItems.length; i++) {
18
+ var linkToCopy = menuItems[i].querySelector("a");
19
+ if (linkToCopy || includeInline) {
20
+ var listItem = document.createElement("li");
21
+ listItem.className =
22
+ menuItems[i].className !== "" ? menuItems[i].className : "nav-item";
23
+ if (linkToCopy) {
24
+ var link = document.createElement("a");
25
+ link.href = linkToCopy.href;
26
+ link.text = linkToCopy.text;
27
+ link.className = linkToCopy.className;
28
+ listItem.appendChild(link);
29
+ }
30
+ else if (includeInline) {
31
+ listItem.innerHTML = menuItems[i].innerHTML;
32
+ }
33
+ document.getElementById("mobileMenuList")?.appendChild(listItem);
34
+ }
35
+ }
36
+ }
37
+ });
@@ -0,0 +1,35 @@
1
+ /* eslint no-var: off */
2
+ // JavaScript that originally was placed in kth-style
3
+ // It copies the content of the main menu and places it in the left mobile
4
+ window.addEventListener("load", () => {
5
+ // If no mobile menu container is present, skip everything
6
+ if (!document.getElementById("mobileMenuList")) {
7
+ return;
8
+ }
9
+ var mainMenu = document.getElementById("mainMenu"); // Get main menu
10
+ if (mainMenu) {
11
+ // For main menu items, copy a link if it exists, otherwise copy the link content
12
+ createMobileMenuItems(mainMenu.querySelectorAll("li"), true);
13
+ }
14
+ function createMobileMenuItems(menuItems, includeInline) {
15
+ for (var i = 0; i < menuItems.length; i++) {
16
+ var linkToCopy = menuItems[i].querySelector("a");
17
+ if (linkToCopy || includeInline) {
18
+ var listItem = document.createElement("li");
19
+ listItem.className =
20
+ menuItems[i].className !== "" ? menuItems[i].className : "nav-item";
21
+ if (linkToCopy) {
22
+ var link = document.createElement("a");
23
+ link.href = linkToCopy.href;
24
+ link.text = linkToCopy.text;
25
+ link.className = linkToCopy.className;
26
+ listItem.appendChild(link);
27
+ }
28
+ else if (includeInline) {
29
+ listItem.innerHTML = menuItems[i].innerHTML;
30
+ }
31
+ document.getElementById("mobileMenuList")?.appendChild(listItem);
32
+ }
33
+ }
34
+ }
35
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kth/style",
3
- "version": "0.18.3",
3
+ "version": "0.18.5",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "exports": {
@@ -22,19 +22,20 @@
22
22
  padding-inline: spacing.$space-8;
23
23
  }
24
24
 
25
+ a[aria-current="true"] {
26
+ background: var(--color-header, transparent);
27
+ }
28
+
25
29
  a:not([href*="intra"], [href*="student"])[aria-current="true"] {
26
- background: colors.$color-blue-kth;
27
- --color-primary: #{colors.$color-white};
30
+ @include colors.theme-inverse;
28
31
  }
29
32
 
30
33
  a[href*="student"][aria-current="true"] {
31
- background: colors.$color-blue-light;
32
- --color-primary: #{colors.$color-blue-kth};
34
+ @include colors.theme-student-web;
33
35
  }
34
36
 
35
37
  a[href*="intra"][aria-current="true"] {
36
- background: colors.$color-sand;
37
- --color-primary: #{colors.$color-blue-kth};
38
+ @include colors.theme-intranet;
38
39
  }
39
40
  }
40
41
  }
@@ -93,5 +93,9 @@
93
93
  margin-top: spacing.$space-32;
94
94
  }
95
95
  }
96
+
97
+ .block.columnSplitter.row {
98
+ display: block;
99
+ }
96
100
  }
97
101
  }