Skip to content

Commit

Permalink
chore(project): moved global.scss to ui/core, styles cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Lillebo committed Oct 14, 2024
1 parent a974edb commit 87feebb
Show file tree
Hide file tree
Showing 14 changed files with 73 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ description: About assessing metadata quality on data.norge.no and why we do it

Data.norge.no has four levels of metadata quality:

| Level | Explanation |
|----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------|
| **Excellent** | This is great! 75% or more of the quality criteria are met. The description is informative and provides great value to the user, which should be the goal for all descriptions. |
| **Good** | 50-75% of the quality criteria are met. |
| **Sufficient** (should be improved) | Only 25-50% of the quality criteria are met, and the description should definitely be improved. |
| **Poor** | 25% or fewer of the quality criteria are met. The description is incomplete and rarely covers the needed information. |
| Level | Explanation |
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Excellent** | This is great! 75% or more of the quality criteria are met. The description is informative and provides great value to the user, which should be the goal for all descriptions. |
| **Good** | 50-75% of the quality criteria are met. |
| **Sufficient** (should be improved) | Only 25-50% of the quality criteria are met, and the description should definitely be improved. |
| **Poor** | 25% or fewer of the quality criteria are met. The description is incomplete and rarely covers the needed information. |

## Why We Measure Metadata Quality

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ description: Om vurdering av metadatakvalitet på data.norge.no og hvofor vi gj

Data.norge.no har fire ulike nivåer for metadatakvalitet:

| Nivå | Begrunnelse |
|----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------|
| **Utmerket** | Dette er bra saker! 75 % eller flere av kvalitetskriteriene er innfridd. Beskrivelsen er informativ og gir stor nytteverdi for brukeren, noe som bør være målet for alle beskrivelser. |
| **God** | 50-75 % av kvalitetskriteriene er innfridd. |
| **Tilstrekkelig** (bør forbedres) | Bare 25-50 % av kvalitetskriteriene er innfridd, og beskrivelsen bør absolutt forbedres. |
| **Dårlig** | 25 % eller færre av kvalitetskriteriene er innfridd. Beskrivelsen er mangelfull og dekker sjelden. |
| Nivå | Begrunnelse |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Utmerket** | Dette er bra saker! 75 % eller flere av kvalitetskriteriene er innfridd. Beskrivelsen er informativ og gir stor nytteverdi for brukeren, noe som bør være målet for alle beskrivelser. |
| **God** | 50-75 % av kvalitetskriteriene er innfridd. |
| **Tilstrekkelig** (bør forbedres) | Bare 25-50 % av kvalitetskriteriene er innfridd, og beskrivelsen bør absolutt forbedres. |
| **Dårlig** | 25 % eller færre av kvalitetskriteriene er innfridd. Beskrivelsen er mangelfull og dekker sjelden. |

## Hvorfor måler vi metadatakvalitet

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@ description: Om vurdering av metadatakvalitet på data.norge.no og kvifor vi gje

Data.norge.no har fire ulike nivå for metadatakvalitet:

| Nivå | Grunngjeving |
|----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|
| **Fremifrå** | Dette er bra saker! 75 % eller fleire av kvalitetskriteria er oppfylte. Skildringa er informativ og gjev stor nytteverdi for brukaren, noko som bør vere målet for alle skildringar. |
| **God** | 50-75 % av kvalitetskriteria er oppfylte. |
| **Tilstrekkeleg** (bør forbetrast) | Berre 25-50 % av kvalitetskriteria er oppfylte, og skildringa bør absolutt forbetrast. |
| **Dårleg** | 25 % eller færre av kvalitetskriteria er oppfylte. Skildringa er mangelfull og dekkjer sjeldan det nødvendige. |

| Nivå | Grunngjeving |
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Fremifrå** | Dette er bra saker! 75 % eller fleire av kvalitetskriteria er oppfylte. Skildringa er informativ og gjev stor nytteverdi for brukaren, noko som bør vere målet for alle skildringar. |
| **God** | 50-75 % av kvalitetskriteria er oppfylte. |
| **Tilstrekkeleg** (bør forbetrast) | Berre 25-50 % av kvalitetskriteria er oppfylte, og skildringa bør absolutt forbetrast. |
| **Dårleg** | 25 % eller færre av kvalitetskriteria er oppfylte. Skildringa er mangelfull og dekkjer sjeldan det nødvendige. |

## Kvifor måler vi metadatakvalitet

Expand Down
14 changes: 12 additions & 2 deletions apps/docs/src/app/[lang]/[...slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,12 @@ export default async function Page({ params }: DocsPageType) {
{...props}
/>
),
p: (props: React.HTMLAttributes<HTMLParagraphElement>) => <Paragraph size="sm" {...props} />,
p: (props: React.HTMLAttributes<HTMLParagraphElement>) => (
<Paragraph
size='sm'
{...props}
/>
),
Alert: ({ size = 'sm', iconTitle = ' ', ...props }: AlertProps) => (
<Alert
size={size}
Expand All @@ -125,7 +130,12 @@ export default async function Page({ params }: DocsPageType) {
),
Image,
table: ({ children, ...props }: React.TableHTMLAttributes<HTMLTableElement>) => (
<Table {...(props as any)} size="sm">{children}</Table>
<Table
{...(props as any)}
size='sm'
>
{children}
</Table>
),
thead: ({ children, ...props }: React.HTMLAttributes<HTMLTableSectionElement>) => (
<TableHead {...props}>{children}</TableHead>
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/src/app/components/sidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React, { useState } from 'react';
import { usePathname } from 'next/navigation';
import cn from 'classnames';

import { Link, Heading, Button } from '@digdir/designsystemet-react';
import { Heading, Button } from '@digdir/designsystemet-react';
import { ChevronDownIcon, ChevronUpIcon } from '@navikt/aksel-icons';

import { type LocaleCodes, type Dictionary } from '@fdk-frontend/dictionaries';
Expand Down Expand Up @@ -149,7 +149,7 @@ const Sidebar = ({ dictionary, slug, locale }: SidebarProps) => {
level={2}
size='xs'
>
<Link href={`/${locale}${nestedData?.[0]?.path}`}>{nestedData?.[0]?.title}</Link>
<a href={`/${locale}${nestedData?.[0]?.path}`}>{nestedData?.[0]?.title}</a>
</Heading>
<NestedList
items={nestedData[0]?.children || []}
Expand Down
4 changes: 4 additions & 0 deletions apps/docs/src/app/components/sidebar/sidebar.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
&:hover {
text-decoration: underline;
}

&:focus-visible {
@include fds-focus-visible-block();
}
}
}
}
Expand Down
8 changes: 8 additions & 0 deletions libs/ui/src/lib/breadcrumbs/breadcrumbs.module.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '@fdk-frontend/ui/core/mixins';

.container {
padding: 0 2rem;
}
Expand All @@ -11,6 +13,12 @@

a {
color: var(--color-link);
border-bottom: 3px solid transparent;

&:focus-visible {
color: black;
border-bottom: 3px solid black;
}
}

@media (max-width: 865px) {
Expand Down
35 changes: 13 additions & 22 deletions libs/ui/src/lib/core/fds-overrides.scss
Original file line number Diff line number Diff line change
@@ -1,36 +1,27 @@
* {
font-family: inherit;
// font-size: inherit;
}

.fds-heading {
// &--lg {
// font-size:2.25rem;
// line-height:1.3em;
// }
// &--md {
// font-size:1.875rem;
// line-height:1.3em;
// }
// &--sm {
// font-size: 1.5rem;
// line-height: 1.3em;
// }
// &--xs {
// font-size: 1.3125rem;
// line-height: 1.3em;
// }
&--xxs {
font-size: 1.1rem;
font-weight: 600;
line-height: 1.3em;
}
}

// .fds-ingress {
// font-size: 1.1em;
// line-height: 1.5em;
// }
.fds-ingress {
font-size: 1.1rem;
line-height: 1.5em;
}

.fds-link {
&:visited {
&:not(:focus-visible) {
color: var(--color-link);
}
}
}

.fds-btn {
&.fds-link {
Expand Down Expand Up @@ -58,6 +49,6 @@
.fds-link,
.fds-btn {
svg {
font-size:1.3rem;
font-size: 1.3rem;
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
/* Define layers in specific order */
@layer reset, fds;

@import url('reset.css');
@import url('@digdir/designsystemet-theme');
@import url('@digdir/designsystemet-css');
// This must be imported before designsystem styles below
@import './reset.css';

@import '@fdk-frontend/ui/core/mixins';
@import '@fdk-frontend/ui/core/fds-overrides';
@import '@digdir/designsystemet-theme';
@import '@digdir/designsystemet-css';

@import './mixins';
@import './fds-overrides';

/* Small devices such as large phones (640px and up) */

Expand Down Expand Up @@ -51,4 +53,4 @@ html {
@media (max-width: 650px) {
font-size: 14px;
}
}
}
File renamed without changes.
2 changes: 1 addition & 1 deletion libs/ui/src/lib/footer/footer.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
color: white;
}

a {
:global(.fds-link) {
color: var(--fds-semantic-border-action-first-subtle);

svg {
Expand Down
6 changes: 3 additions & 3 deletions libs/ui/src/lib/language-switcher/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ const LanguageSwitcher = ({ inverted }: LanguageSwitcherProps) => {
};

return (
<nav aria-label="Select language">
<nav aria-label='Select language'>
<ToggleGroup
className={cn(styles.languageSwitcher, { [styles.inverted]: inverted })}
defaultValue={defaultCode}
size='sm'
onChange={(code) => onLanguageSelect(code as LocaleCodes)}
name="Select language"
name='Select language'
>
{i18n.locales.map((locale) => (
<ToggleGroup.Item
value={locale.code}
key={locale.code}
>
<span aria-hidden="true">{locale.flag}</span> {locale.name}
<span aria-hidden='true'>{locale.flag}</span> {locale.name}
</ToggleGroup.Item>
))}
</ToggleGroup>
Expand Down
2 changes: 1 addition & 1 deletion libs/ui/src/lib/layout-root/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'server-only';

import './global.scss';
import '../core/global.scss';

import { PropsWithChildren } from 'react';
import { getDictionary, i18n, type Locale } from '@fdk-frontend/dictionaries';
Expand Down
6 changes: 3 additions & 3 deletions libs/ui/src/lib/layouts/feedback-layout/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { PropsWithChildren } from 'react';

import { Heading, Paragraph, Link } from '@digdir/designsystemet-react';
import { Heading, Link } from '@digdir/designsystemet-react';
import { ExternalLinkIcon } from '@navikt/aksel-icons';

import { type Dictionary, interpolate } from '@fdk-frontend/dictionaries';
Expand Down Expand Up @@ -31,7 +31,7 @@ const FeedbackLayout = async ({
>
{dictionary.feedbackBanner.heading}
</Heading>
<Paragraph>
<div>
{interpolate(dictionary.feedbackBanner.text, {
contactLink: (
<Link href={`${baseUri}/contact`}>{dictionary.feedbackBanner.contactLinkText}</Link>
Expand All @@ -43,7 +43,7 @@ const FeedbackLayout = async ({
</Link>
),
})}
</Paragraph>
</div>
</div>
</div>
</div>
Expand Down

0 comments on commit 87feebb

Please sign in to comment.