coherent-docs-theme 1.0.4 → 1.0.6
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.
|
@@ -8,11 +8,11 @@ interface Props {
|
|
|
8
8
|
|
|
9
9
|
const { type = "header" } = Astro.props;
|
|
10
10
|
const { navLinks, documentationSearchTag } = getThemeConfig();
|
|
11
|
-
const currentUrl = Astro.url;
|
|
12
11
|
|
|
13
12
|
const isLinkActive = (href: string, label: string) => {
|
|
14
13
|
try {
|
|
15
|
-
const linkUrl = new URL(href,
|
|
14
|
+
const linkUrl = new URL(href, Astro.url.origin);
|
|
15
|
+
const currentUrl = Astro.url;
|
|
16
16
|
const isLocal =
|
|
17
17
|
currentUrl.hostname === "localhost" ||
|
|
18
18
|
currentUrl.hostname === "127.0.0.1";
|
|
@@ -21,21 +21,10 @@ const isLinkActive = (href: string, label: string) => {
|
|
|
21
21
|
const currentPath = normalize(currentUrl.pathname);
|
|
22
22
|
const linkPath = normalize(linkUrl.pathname);
|
|
23
23
|
|
|
24
|
-
if (isLocal)
|
|
25
|
-
const isCurrentProject = label === documentationSearchTag;
|
|
26
|
-
|
|
27
|
-
if (!isCurrentProject) return false;
|
|
28
|
-
|
|
29
|
-
if (linkPath === "/") return true;
|
|
30
|
-
return (
|
|
31
|
-
currentPath === linkPath ||
|
|
32
|
-
currentPath.startsWith(linkPath + "/")
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
|
|
24
|
+
if (isLocal) return label === documentationSearchTag;
|
|
36
25
|
if (linkUrl.origin !== currentUrl.origin) return false;
|
|
26
|
+
if (linkPath === "/") return true;
|
|
37
27
|
|
|
38
|
-
if (linkPath === "/") return currentPath === "/";
|
|
39
28
|
return (
|
|
40
29
|
currentPath === linkPath || currentPath.startsWith(linkPath + "/")
|
|
41
30
|
);
|
|
@@ -130,6 +119,7 @@ const activeLabel = activeLinkObj ? activeLinkObj.label : "Documentations";
|
|
|
130
119
|
}
|
|
131
120
|
|
|
132
121
|
.nav-link {
|
|
122
|
+
position: relative;
|
|
133
123
|
color: var(--sl-color-gray-3);
|
|
134
124
|
text-decoration: none;
|
|
135
125
|
font-size: 0.85rem;
|
|
@@ -137,16 +127,37 @@ const activeLabel = activeLinkObj ? activeLinkObj.label : "Documentations";
|
|
|
137
127
|
text-transform: uppercase;
|
|
138
128
|
display: block;
|
|
139
129
|
padding: 0.5rem 0;
|
|
140
|
-
transition: color 0.2s;
|
|
130
|
+
transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.nav-link::after {
|
|
134
|
+
content: "";
|
|
135
|
+
position: absolute;
|
|
136
|
+
bottom: 0;
|
|
137
|
+
left: 0;
|
|
138
|
+
width: 100%;
|
|
139
|
+
height: 2px;
|
|
140
|
+
background-color: var(--sl-color-accent);
|
|
141
|
+
transform: scaleX(0);
|
|
142
|
+
transform-origin: center;
|
|
143
|
+
transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
141
144
|
}
|
|
142
145
|
|
|
143
146
|
.nav-link:hover,
|
|
144
147
|
.nav-link.active {
|
|
145
|
-
color: var(--sl-color-
|
|
148
|
+
color: var(--sl-color-accent);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.nav-link:hover::after,
|
|
152
|
+
.nav-link.active::after {
|
|
153
|
+
transform: scaleX(1);
|
|
154
|
+
transform-origin: center;
|
|
146
155
|
}
|
|
156
|
+
|
|
147
157
|
.nav-link.active {
|
|
148
|
-
color: var(--sl-color-
|
|
158
|
+
color: var(--sl-color-white);
|
|
149
159
|
}
|
|
160
|
+
|
|
150
161
|
.collapsed-menu {
|
|
151
162
|
position: relative;
|
|
152
163
|
}
|
|
@@ -203,16 +214,14 @@ const activeLabel = activeLinkObj ? activeLinkObj.label : "Documentations";
|
|
|
203
214
|
color: var(--sl-color-gray-3);
|
|
204
215
|
text-decoration: none;
|
|
205
216
|
font-size: 0.9rem;
|
|
217
|
+
transition: all 0.2s ease;
|
|
206
218
|
}
|
|
207
219
|
|
|
208
|
-
.dropdown-link:hover
|
|
209
|
-
background-color: var(--sl-color-gray-6);
|
|
210
|
-
color: var(--sl-color-white);
|
|
211
|
-
}
|
|
212
|
-
|
|
220
|
+
.dropdown-link:hover,
|
|
213
221
|
.dropdown-link.active {
|
|
222
|
+
background-color: rgba(var(--sl-color-accent-rgb), 0.1);
|
|
214
223
|
color: var(--sl-color-accent);
|
|
215
|
-
|
|
224
|
+
padding-left: 1.75rem;
|
|
216
225
|
}
|
|
217
226
|
</style>
|
|
218
227
|
|
package/overrides/Search.astro
CHANGED
|
@@ -100,8 +100,8 @@ const isDev = import.meta.env.DEV;
|
|
|
100
100
|
"frontend-tools.coherent-labs.com/gameface-vite-plugin": { text: "UI Tools | Gameface Vite Plugin", color: "#007acc" },
|
|
101
101
|
"frontend-tools.coherent-labs.com/vite-solid-style-to-css-plugin": { text: "UI Tools | Solid Style to CSS Plugin", color: "#007add" },
|
|
102
102
|
"frontend-tools.coherent-labs.com/data-binding-autocomplete": { text: "UI Tools | Data Binding Autocomplete", color: "#007aee" },
|
|
103
|
-
"frontend-tools.coherent-labs.com
|
|
104
|
-
"gameface-ui": { text: "Gameface UI", color: "#e24a4a" },
|
|
103
|
+
"frontend-tools.coherent-labs.com": { text: "UI Tools", color: "#007aff" },
|
|
104
|
+
"gameface-ui.coherent-labs.com": { text: "Gameface UI", color: "#e24a4a" },
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
function setupSearchInputListener(searchInput, pagefind) {
|