Skip to content

Commit d269a09

Browse files
committed
fix: base href references
1 parent 9d50789 commit d269a09

2 files changed

Lines changed: 33 additions & 5 deletions

File tree

src/app/app.config.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
1+
import { DOCUMENT } from '@angular/common';
2+
import { IMAGE_LOADER, ImageLoaderConfig } from '@angular/common';
13
import { ApplicationConfig, provideBrowserGlobalErrorListeners } from '@angular/core';
24

35
export const appConfig: ApplicationConfig = {
46
providers: [
57
provideBrowserGlobalErrorListeners(),
6-
7-
]
8+
{
9+
provide: IMAGE_LOADER,
10+
useFactory: (document: Document) => (config: ImageLoaderConfig): string => {
11+
const base = document.querySelector('base')?.getAttribute('href') ?? '/';
12+
const baseNormalized = base.endsWith('/') ? base.slice(0, -1) : base;
13+
return baseNormalized + config.src;
14+
},
15+
deps: [DOCUMENT],
16+
},
17+
],
818
};

src/styles.scss

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,32 @@
44
@layer base {
55
[role='button'],
66
button {
7-
@apply inline-flex items-center justify-center gap-2 px-4 py-2 border-2 border-(--color-primary) rounded-(--radius) text-base font-semibold no-underline cursor-pointer transition-colors bg-(--color-primary) text-white;
7+
display: inline-flex;
8+
align-items: center;
9+
justify-content: center;
10+
gap: 0.5rem;
11+
padding: 0.5rem 1rem;
12+
border: 2px solid var(--color-primary);
13+
border-radius: var(--radius);
14+
font-size: 1rem;
15+
font-weight: 600;
16+
text-decoration: none;
17+
cursor: pointer;
18+
transition-property: color, background-color, border-color;
19+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
20+
transition-duration: 150ms;
21+
background-color: var(--color-primary);
22+
color: #fff;
823

924
svg {
10-
@apply shrink-0 fill-current;
25+
flex-shrink: 0;
26+
fill: currentColor;
1127
}
1228

1329
&:hover {
14-
@apply bg-(--color-primary-hover) border-(--color-primary-hover) text-white;
30+
background-color: var(--color-primary-hover);
31+
border-color: var(--color-primary-hover);
32+
color: #fff;
1533
}
1634
}
1735
}

0 commit comments

Comments
 (0)