@kth/style 0.1.0 → 0.2.0
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/README.md +28 -22
- package/dist/cjs/components/MenuPanel.d.ts +13 -0
- package/dist/cjs/index.d.ts +1 -3
- package/dist/cjs/index.js +54 -127
- package/dist/cjs/react.d.ts +1 -5
- package/dist/cjs/react.js +3 -175
- package/dist/esm/components/MenuPanel.d.ts +13 -0
- package/dist/esm/index.d.ts +1 -3
- package/dist/esm/index.js +54 -125
- package/dist/esm/react.d.ts +1 -5
- package/dist/esm/react.js +3 -147
- package/package.json +2 -12
- package/scss/components/a11y-nav.scss +31 -0
- package/scss/components/button.scss +18 -54
- package/scss/components/header.scss +40 -0
- package/scss/components/logotype.scss +28 -0
- package/scss/components/mega-menu.scss +33 -0
- package/scss/components/menu-item.scss +40 -0
- package/scss/components/menu-panel.scss +32 -0
- package/scss/components/search.scss +3 -1
- package/scss/components/visually-hidden.scss +11 -0
- package/scss/tokens/colors.scss +0 -3
- package/scss/tokens/icons.scss +11 -10
- package/scss/tokens/spacing.scss +0 -65
- package/scss/utils/mixins.scss +5 -0
- package/scss/utils/prose.scss +10 -5
- package/scss/utils/reset.scss +35 -21
- package/dist/cjs/components/Button.d.ts +0 -20
- package/dist/cjs/components/ModalNavigationPanel.d.ts +0 -4
- package/dist/cjs/components/NavigationPanel.d.ts +0 -7
- package/dist/cjs/components/Radio.d.ts +0 -20
- package/dist/cjs/components/Select.d.ts +0 -34
- package/dist/cjs/components/Tabs.d.ts +0 -1
- package/dist/cjs/components/react/PersonalMenuPanel.d.ts +0 -19
- package/dist/cjs/components/react/Tabs.d.ts +0 -34
- package/dist/cjs/icons/400/ArrowBack.d.ts +0 -4
- package/dist/cjs/icons/400/Check.d.ts +0 -4
- package/dist/cjs/icons/500/ArrowForward.d.ts +0 -4
- package/dist/cjs/stories/Button.stories.d.ts +0 -14
- package/dist/cjs/stories/ContentTabs.stories.d.ts +0 -12
- package/dist/cjs/stories/FilterTabs.stories.d.ts +0 -12
- package/dist/cjs/stories/InlineIcons.stories.d.ts +0 -9
- package/dist/cjs/stories/Select.stories.d.ts +0 -14
- package/dist/esm/components/Button.d.ts +0 -20
- package/dist/esm/components/ModalNavigationPanel.d.ts +0 -4
- package/dist/esm/components/NavigationPanel.d.ts +0 -7
- package/dist/esm/components/Radio.d.ts +0 -20
- package/dist/esm/components/Select.d.ts +0 -34
- package/dist/esm/components/Tabs.d.ts +0 -1
- package/dist/esm/components/react/PersonalMenuPanel.d.ts +0 -19
- package/dist/esm/components/react/Tabs.d.ts +0 -34
- package/dist/esm/icons/400/ArrowBack.d.ts +0 -4
- package/dist/esm/icons/400/Check.d.ts +0 -4
- package/dist/esm/icons/500/ArrowForward.d.ts +0 -4
- package/dist/esm/stories/Button.stories.d.ts +0 -14
- package/dist/esm/stories/ContentTabs.stories.d.ts +0 -12
- package/dist/esm/stories/FilterTabs.stories.d.ts +0 -12
- package/dist/esm/stories/InlineIcons.stories.d.ts +0 -9
- package/dist/esm/stories/Select.stories.d.ts +0 -14
- package/scss/components/checkbox.scss +0 -63
- package/scss/components/details.scss +0 -40
- package/scss/components/fieldset.scss +0 -60
- package/scss/components/form-control.scss +0 -25
- package/scss/components/header-menu-item.scss +0 -38
- package/scss/components/input.scss +0 -21
- package/scss/components/main-header.scss +0 -105
- package/scss/components/select.scss +0 -46
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
interface SelectProps {
|
|
3
|
-
/** Equivalent to HTML `name` */
|
|
4
|
-
name: string;
|
|
5
|
-
/** Label for the select */
|
|
6
|
-
label: string;
|
|
7
|
-
/** Select description */
|
|
8
|
-
description?: string;
|
|
9
|
-
/** Current value of the select field */
|
|
10
|
-
value: string;
|
|
11
|
-
/** Called when the select value changes */
|
|
12
|
-
onChange(value: string): void;
|
|
13
|
-
/** Options */
|
|
14
|
-
children: React.ReactNode;
|
|
15
|
-
/**
|
|
16
|
-
* Error message if the field has errors. `undefined` here means the field
|
|
17
|
-
* contains no error.
|
|
18
|
-
*/
|
|
19
|
-
error?: string;
|
|
20
|
-
}
|
|
21
|
-
interface OptionProps {
|
|
22
|
-
/** The value for the option */
|
|
23
|
-
value: string;
|
|
24
|
-
/** Human-readable label for the option */
|
|
25
|
-
children: string;
|
|
26
|
-
}
|
|
27
|
-
interface OptionGroupProps {
|
|
28
|
-
label: string;
|
|
29
|
-
children: React.ReactNode;
|
|
30
|
-
}
|
|
31
|
-
export declare function Select({ name, label, description, value, onChange, children, error, }: SelectProps): React.JSX.Element;
|
|
32
|
-
export declare function OptionGroup({ label, children }: OptionGroupProps): React.JSX.Element;
|
|
33
|
-
export declare function Option({ value, children }: OptionProps): React.JSX.Element;
|
|
34
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function initTabs(container: Element): void;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
/**
|
|
3
|
-
* A panel with a button that opens it.
|
|
4
|
-
*
|
|
5
|
-
* - `children` is mounted the first time the dialog is opened. It is _not_
|
|
6
|
-
* unmounted after the dialog is closed.
|
|
7
|
-
*/
|
|
8
|
-
export declare function PersonalMenuPanel({ label, children }: {
|
|
9
|
-
label: any;
|
|
10
|
-
children: any;
|
|
11
|
-
}): React.JSX.Element;
|
|
12
|
-
interface PersonalMenuPanelGroupProps {
|
|
13
|
-
children: React.ReactElement;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Contains all <PersonalMenuPanel /> components in a menu
|
|
17
|
-
*/
|
|
18
|
-
export declare function PersonalMenuPanelGroup({ children, }: PersonalMenuPanelGroupProps): React.JSX.Element;
|
|
19
|
-
export {};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
interface TabProps {
|
|
3
|
-
children?: React.ReactNode;
|
|
4
|
-
id: string;
|
|
5
|
-
title: string;
|
|
6
|
-
}
|
|
7
|
-
interface GenericTabsProps {
|
|
8
|
-
classPrefix: string;
|
|
9
|
-
children: React.ReactElement<TabProps>[];
|
|
10
|
-
id: string;
|
|
11
|
-
defaultValue?: string;
|
|
12
|
-
url: "query" | "hash" | "none";
|
|
13
|
-
}
|
|
14
|
-
interface NavigationTabsProps {
|
|
15
|
-
id: string;
|
|
16
|
-
children: React.ReactElement<TabProps>[];
|
|
17
|
-
url?: "query" | "none";
|
|
18
|
-
defaultValue?: string;
|
|
19
|
-
}
|
|
20
|
-
interface ContentTabsProps {
|
|
21
|
-
id: string;
|
|
22
|
-
children: React.ReactElement<TabProps>[];
|
|
23
|
-
url?: "hash" | "none";
|
|
24
|
-
defaultValue?: string;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Highly customizable Tabs component made for testing purposes.
|
|
28
|
-
* You should use {@link NavigationTabs} or {@link ContentTabs} instead.
|
|
29
|
-
*/
|
|
30
|
-
export declare function GenericTabs({ classPrefix, children, id, defaultValue, url, }: GenericTabsProps): React.JSX.Element;
|
|
31
|
-
export declare function NavigationTabs({ id, children, url, defaultValue, }: NavigationTabsProps): React.JSX.Element;
|
|
32
|
-
export declare function ContentTabs({ id, children, url, defaultValue, }: ContentTabsProps): React.JSX.Element;
|
|
33
|
-
export declare function Tab({ children }: TabProps): React.JSX.Element;
|
|
34
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from "@storybook/react";
|
|
2
|
-
import { Button } from "../components/Button";
|
|
3
|
-
import "../../scss/globals.scss";
|
|
4
|
-
import "../../scss/components/button.scss";
|
|
5
|
-
declare const meta: {
|
|
6
|
-
title: string;
|
|
7
|
-
component: typeof Button;
|
|
8
|
-
tags: string[];
|
|
9
|
-
};
|
|
10
|
-
export default meta;
|
|
11
|
-
type Story = StoryObj<typeof meta>;
|
|
12
|
-
export declare const Primary: Story;
|
|
13
|
-
export declare const Back: StoryObj;
|
|
14
|
-
export declare const Forward: StoryObj;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from "@storybook/react";
|
|
2
|
-
import "../../scss/globals.scss";
|
|
3
|
-
import "../../scss/components/content-tabs.scss";
|
|
4
|
-
declare const meta: {
|
|
5
|
-
title: string;
|
|
6
|
-
component: any;
|
|
7
|
-
tags: string[];
|
|
8
|
-
};
|
|
9
|
-
export default meta;
|
|
10
|
-
type Story = StoryObj<typeof meta>;
|
|
11
|
-
export declare const Primary: Story;
|
|
12
|
-
export declare const Secondary: Story;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from "@storybook/react";
|
|
2
|
-
import { FilterTabs } from "../components/Radio";
|
|
3
|
-
import "../../scss/globals.scss";
|
|
4
|
-
import "../../scss/components/filter-tabs.scss";
|
|
5
|
-
declare const meta: {
|
|
6
|
-
title: string;
|
|
7
|
-
component: typeof FilterTabs;
|
|
8
|
-
tags: string[];
|
|
9
|
-
};
|
|
10
|
-
export default meta;
|
|
11
|
-
type Story = StoryObj<typeof meta>;
|
|
12
|
-
export declare const Primary: Story;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from "@storybook/react";
|
|
2
|
-
import "../../scss/globals.scss";
|
|
3
|
-
import "../../scss/components/inline-icon.scss";
|
|
4
|
-
declare const meta: {
|
|
5
|
-
title: string;
|
|
6
|
-
tags: string[];
|
|
7
|
-
};
|
|
8
|
-
export default meta;
|
|
9
|
-
export declare const CheckIcon: StoryObj;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from "@storybook/react";
|
|
2
|
-
import { Select } from "../components/Select";
|
|
3
|
-
import "../../scss/globals.scss";
|
|
4
|
-
import "../../scss/components/form.scss";
|
|
5
|
-
declare const meta: {
|
|
6
|
-
title: string;
|
|
7
|
-
component: typeof Select;
|
|
8
|
-
tags: string[];
|
|
9
|
-
};
|
|
10
|
-
export default meta;
|
|
11
|
-
type Story = StoryObj<typeof meta>;
|
|
12
|
-
export declare const WithDescriptions: Story;
|
|
13
|
-
export declare const WithoutDescriptions: Story;
|
|
14
|
-
export declare const WithError: Story;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
@use "../tokens/spacing.scss";
|
|
2
|
-
@use "../tokens/icons.scss";
|
|
3
|
-
@use "sass:math";
|
|
4
|
-
|
|
5
|
-
// TODO: move to its own tokens
|
|
6
|
-
$secondary-border-width: math.div(1rem, 16);
|
|
7
|
-
$input-size: spacing.$space-24;
|
|
8
|
-
$input-inner-size: spacing.$space-16;
|
|
9
|
-
|
|
10
|
-
@layer kth-style {
|
|
11
|
-
input[type="checkbox"],
|
|
12
|
-
input[type="radio"] {
|
|
13
|
-
appearance: none;
|
|
14
|
-
-webkit-appearance: none;
|
|
15
|
-
background-color: transparent;
|
|
16
|
-
margin-inline: 0;
|
|
17
|
-
margin-block: var(--space-inner-block);
|
|
18
|
-
font: inherit;
|
|
19
|
-
width: $input-size;
|
|
20
|
-
height: $input-size;
|
|
21
|
-
border-width: var(--border-width);
|
|
22
|
-
border-style: solid;
|
|
23
|
-
border-color: currentColor;
|
|
24
|
-
display: grid;
|
|
25
|
-
place-content: center;
|
|
26
|
-
|
|
27
|
-
&::before {
|
|
28
|
-
content: "";
|
|
29
|
-
transform: scale(0);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
&:checked::before {
|
|
33
|
-
transform: scale(1);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
input[type="checkbox"] {
|
|
38
|
-
border-radius: spacing.$space-4;
|
|
39
|
-
|
|
40
|
-
&::before {
|
|
41
|
-
width: $input-size;
|
|
42
|
-
height: $input-size;
|
|
43
|
-
box-shadow: inset $input-size $input-size var(--color-primary);
|
|
44
|
-
|
|
45
|
-
-webkit-mask-image: icons.$icon-check;
|
|
46
|
-
mask-image: icons.$icon-check;
|
|
47
|
-
|
|
48
|
-
// Windows High Contrast Mode
|
|
49
|
-
background-color: CanvasText;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
input[type="radio"] {
|
|
54
|
-
border-radius: 100%;
|
|
55
|
-
|
|
56
|
-
&::before {
|
|
57
|
-
width: $input-inner-size;
|
|
58
|
-
height: $input-inner-size;
|
|
59
|
-
background-color: var(--color-primary);
|
|
60
|
-
border-radius: 100%;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
@use "../tokens/spacing.scss";
|
|
2
|
-
@use "../tokens/icons.scss";
|
|
3
|
-
|
|
4
|
-
$border-width: spacing.$space-4;
|
|
5
|
-
|
|
6
|
-
@layer kth-style {
|
|
7
|
-
.kth-details {
|
|
8
|
-
summary {
|
|
9
|
-
color: var(--color-tertiary);
|
|
10
|
-
padding-block: var(--space-inner-block);
|
|
11
|
-
cursor: pointer;
|
|
12
|
-
// padding-inline-start: spacing.$space-20;
|
|
13
|
-
list-style: none;
|
|
14
|
-
font: inherit;
|
|
15
|
-
display: grid;
|
|
16
|
-
grid-template-columns: 1.5rem auto;
|
|
17
|
-
|
|
18
|
-
&::before {
|
|
19
|
-
@include icons.icon-caret-right;
|
|
20
|
-
background-color: var(--color-tertiary);
|
|
21
|
-
margin-block: spacing.$space-2;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
&:hover {
|
|
25
|
-
text-decoration: underline;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
&[open] summary::before {
|
|
30
|
-
rotate: 0deg;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
&__content {
|
|
34
|
-
border-inline-start: $border-width solid var(--color-tertiary);
|
|
35
|
-
padding-inline-start: spacing.$space-16;
|
|
36
|
-
padding-block: spacing.$space-8;
|
|
37
|
-
margin-inline-start: spacing.$space-8;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
@use "../tokens/spacing.scss";
|
|
2
|
-
@use "../tokens/icons.scss";
|
|
3
|
-
@use "sass:math";
|
|
4
|
-
|
|
5
|
-
$secondary-border-width: math.div(1rem, 16);
|
|
6
|
-
$input-size: 1.5rem;
|
|
7
|
-
|
|
8
|
-
// Coded as <fieldset>
|
|
9
|
-
.kth-fieldset {
|
|
10
|
-
border: 0;
|
|
11
|
-
padding: 0;
|
|
12
|
-
margin-inline: 0;
|
|
13
|
-
margin-block: spacing.$space-24;
|
|
14
|
-
|
|
15
|
-
> legend {
|
|
16
|
-
font: var(--font-label-s);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
&__description {
|
|
20
|
-
margin-block: spacing.$space-4;
|
|
21
|
-
margin-inline: 0;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
&__options {
|
|
25
|
-
--border-width: #{$secondary-border-width};
|
|
26
|
-
border-width: var(--border-width);
|
|
27
|
-
border-style: solid;
|
|
28
|
-
border-color: transparent;
|
|
29
|
-
margin-block: calc(0 - var(--border-width));
|
|
30
|
-
padding-inline: calc(#{spacing.$space-8} - var(--border-width));
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
&.error &__options {
|
|
34
|
-
border-color: var(--color-error, red);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
&.error &__error {
|
|
38
|
-
margin-block: spacing.$space-4;
|
|
39
|
-
color: var(--color-error, red);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
&__option {
|
|
43
|
-
display: grid;
|
|
44
|
-
grid-template-columns: $input-size auto;
|
|
45
|
-
gap: spacing.$space-0 spacing.$space-12;
|
|
46
|
-
|
|
47
|
-
:not(input) {
|
|
48
|
-
grid-column-start: 2;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
label {
|
|
52
|
-
display: inline-block;
|
|
53
|
-
padding-block: var(--space-inner-block);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
&__option-description {
|
|
58
|
-
margin-block-end: spacing.$space-16;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
@use "../tokens/spacing.scss";
|
|
2
|
-
@use "../tokens/icons.scss";
|
|
3
|
-
$secondary-border-width: 1rem/16;
|
|
4
|
-
|
|
5
|
-
@layer kth-style {
|
|
6
|
-
.kth-form-control {
|
|
7
|
-
margin-block: spacing.$space-24;
|
|
8
|
-
|
|
9
|
-
> label {
|
|
10
|
-
font: var(--font-label-s);
|
|
11
|
-
display: block;
|
|
12
|
-
margin-block: spacing.$space-4;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
> .kth-form-control__description {
|
|
16
|
-
margin-block: spacing.$space-4;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// Preferred to select via
|
|
20
|
-
// :has([aria-invalid="true"])... but Firefox does not support `has` yet
|
|
21
|
-
&.error .kth-form-control__error {
|
|
22
|
-
color: var(--color-error, red);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
@use "../tokens/spacing";
|
|
2
|
-
@use "../tokens/icons";
|
|
3
|
-
|
|
4
|
-
.kth-header-menu-item {
|
|
5
|
-
color: var(--color-primary);
|
|
6
|
-
text-decoration: none;
|
|
7
|
-
display: flex;
|
|
8
|
-
align-items: center;
|
|
9
|
-
gap: spacing.gap(4);
|
|
10
|
-
|
|
11
|
-
// Fixes for buttons:
|
|
12
|
-
border: none;
|
|
13
|
-
background: none;
|
|
14
|
-
padding: 0;
|
|
15
|
-
|
|
16
|
-
span {
|
|
17
|
-
padding-block: spacing.padding(8);
|
|
18
|
-
padding-block-end: spacing.padding(4);
|
|
19
|
-
border-bottom: transparent spacing.$space-4 solid;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
&:hover span {
|
|
23
|
-
border-color: var(--color-primary);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
&.dropdown::after {
|
|
27
|
-
@include icons.icon-caret-down;
|
|
28
|
-
background-color: var(--color-primary);
|
|
29
|
-
}
|
|
30
|
-
&.search::before {
|
|
31
|
-
@include icons.icon-search;
|
|
32
|
-
background-color: var(--color-primary);
|
|
33
|
-
}
|
|
34
|
-
&.language::before {
|
|
35
|
-
@include icons.icon-globe;
|
|
36
|
-
background-color: var(--color-primary);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
@use "../tokens/spacing.scss";
|
|
2
|
-
@use "../tokens/icons.scss";
|
|
3
|
-
$secondary-border-width: 1rem/16;
|
|
4
|
-
|
|
5
|
-
@layer kth-style {
|
|
6
|
-
.kth-input {
|
|
7
|
-
--border-width: #{$secondary-border-width};
|
|
8
|
-
|
|
9
|
-
padding-inline: var(--space-inner-inline);
|
|
10
|
-
padding-block: calc(var(--space-inner-block) - var(--border-width));
|
|
11
|
-
border-radius: spacing.$space-4;
|
|
12
|
-
border-width: var(--border-width);
|
|
13
|
-
border-style: solid;
|
|
14
|
-
border-color: var(--color-secondary);
|
|
15
|
-
|
|
16
|
-
&[aria-invalid="true"] {
|
|
17
|
-
color: var(--color-error, red);
|
|
18
|
-
border-color: var(--color-error, red);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
@use "../tokens/colors.scss";
|
|
2
|
-
@use "../tokens/spacing.scss";
|
|
3
|
-
@use "../utils/mixins.scss";
|
|
4
|
-
|
|
5
|
-
@mixin horizontal-list {
|
|
6
|
-
display: flex;
|
|
7
|
-
list-style: none;
|
|
8
|
-
padding: 0;
|
|
9
|
-
margin: 0;
|
|
10
|
-
|
|
11
|
-
> :where(li) {
|
|
12
|
-
padding: 0;
|
|
13
|
-
margin: 0;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.kth-main-header.intranet {
|
|
18
|
-
@include colors.theme-intranet;
|
|
19
|
-
|
|
20
|
-
.kth-main-header__logotype.white {
|
|
21
|
-
display: none;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
.kth-main-header.external {
|
|
25
|
-
@include colors.theme-inverse;
|
|
26
|
-
|
|
27
|
-
.kth-main-header__logotype.blue {
|
|
28
|
-
display: none;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
.kth-main-header.student-web {
|
|
32
|
-
@include colors.theme-student-web;
|
|
33
|
-
|
|
34
|
-
.kth-main-header__logotype.white {
|
|
35
|
-
display: none;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.kth-main-header {
|
|
40
|
-
background: var(--color-background);
|
|
41
|
-
padding-block: spacing.padding(16);
|
|
42
|
-
position: relative;
|
|
43
|
-
|
|
44
|
-
&__container {
|
|
45
|
-
@include mixins.container;
|
|
46
|
-
display: flex;
|
|
47
|
-
align-items: center;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
&__logotype {
|
|
51
|
-
width: 4rem;
|
|
52
|
-
height: 4rem;
|
|
53
|
-
border: none;
|
|
54
|
-
margin: 0;
|
|
55
|
-
margin-inline-end: spacing.margin(32);
|
|
56
|
-
padding: 0;
|
|
57
|
-
|
|
58
|
-
// Defensive measurement:
|
|
59
|
-
// - We prevent logo from shrinking
|
|
60
|
-
flex: 0 0 auto;
|
|
61
|
-
|
|
62
|
-
> img {
|
|
63
|
-
block-size: 100%;
|
|
64
|
-
inline-size: 100%;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
&__mega-menu {
|
|
69
|
-
> ul {
|
|
70
|
-
@include horizontal-list();
|
|
71
|
-
|
|
72
|
-
// Defensive measurements:
|
|
73
|
-
// - `flex-wrap: wrap` makes sure that all menus are displayed decently
|
|
74
|
-
// - `0` in gap (block axis) makes sure that menu spacing is ok all the time
|
|
75
|
-
flex-wrap: wrap;
|
|
76
|
-
gap: 0 spacing.$space-16;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
&__tools {
|
|
81
|
-
@include horizontal-list();
|
|
82
|
-
flex-wrap: wrap;
|
|
83
|
-
gap: 0 spacing.$space-16;
|
|
84
|
-
justify-content: flex-end;
|
|
85
|
-
margin-inline-start: auto;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
&__mega-menu--collapsable {
|
|
89
|
-
display: none;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
@media (width < 64rem) {
|
|
94
|
-
.kth-main-header__logotype {
|
|
95
|
-
margin-inline-end: 0;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.kth-main-header__mega-menu {
|
|
99
|
-
display: none;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.kth-main-header__mega-menu--collapsable {
|
|
103
|
-
display: block;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
@use "../tokens/spacing.scss";
|
|
2
|
-
@use "../tokens/icons.scss";
|
|
3
|
-
$secondary-border-width: 1rem/16;
|
|
4
|
-
|
|
5
|
-
@layer kth-style {
|
|
6
|
-
.kth-select {
|
|
7
|
-
width: 100%;
|
|
8
|
-
min-width: 15ch;
|
|
9
|
-
max-width: 30ch;
|
|
10
|
-
cursor: pointer;
|
|
11
|
-
display: grid;
|
|
12
|
-
grid-template-areas: "select";
|
|
13
|
-
align-items: center;
|
|
14
|
-
position: relative;
|
|
15
|
-
border: none;
|
|
16
|
-
|
|
17
|
-
select {
|
|
18
|
-
--border-width: #{$secondary-border-width};
|
|
19
|
-
padding-block: calc(var(--space-inner-block) - var(--border-width));
|
|
20
|
-
padding-inline: var(--space-inner-inline);
|
|
21
|
-
appearance: none;
|
|
22
|
-
background-color: transparent;
|
|
23
|
-
border-width: var(--border-width);
|
|
24
|
-
border-style: solid;
|
|
25
|
-
border-color: var(--color-secondary);
|
|
26
|
-
border-radius: spacing.$space-4;
|
|
27
|
-
margin: 0;
|
|
28
|
-
width: 100%;
|
|
29
|
-
height: 100%;
|
|
30
|
-
grid-area: select;
|
|
31
|
-
z-index: 1;
|
|
32
|
-
cursor: inherit;
|
|
33
|
-
|
|
34
|
-
&[aria-invalid="true"] {
|
|
35
|
-
border-color: var(--color-error, red);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
&::after {
|
|
40
|
-
@include icons.icon-caret-down;
|
|
41
|
-
background-color: var(--color-secondary);
|
|
42
|
-
grid-area: select;
|
|
43
|
-
justify-self: end;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|