Skip to content

Commit

Permalink
feat: legg til bold som egen klasse
Browse files Browse the repository at this point in the history
Vi har uoffisielt hatt støtte for det med no-grow-bold mixin,
brukt i blant annet Accordion, lenker (ved fokus), faner (aktiv)
og autosuggest (valgt element). Nå også i expand. Gjør det
offisielt støtta med en egen klasse, og dokumenter den i typografi.
  • Loading branch information
wkillerud committed Dec 21, 2021
1 parent c332fa6 commit 2837d10
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
12 changes: 12 additions & 0 deletions packages/core/paragraphs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@
}
}

.jkl-bold {
@include mixins.text-style("body") {
@include mixins.helper-no-grow-bold;
}

*[data-compactlayout] & {
@include mixins.text-style("body/small-screen") {
@include mixins.helper-no-grow-bold;
}
}
}

.jkl-small {
@include mixins.text-style("small");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ export type TypographyLevels =
| "Heading 4"
| "Heading 5"
| "Body"
| "Bold"
| "Small";

interface Props {
level: TypographyLevels;
}

export const ExampleRow: React.FC<Props> = ({ level }) => {
const [fontWeight, setFontWeight] = useState("N/A");
const [fontSize, setFontSize] = useState("N/A");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { VFC, useState } from "react";
import { ToggleSwitch } from "@fremtind/jkl-toggle-switch-react";

import "./TypographyTable.scss";
import { TableHeader } from "./TableHeader";
import { ExampleRow, TypographyLevels } from "./ExampleRow";
Expand All @@ -13,6 +12,7 @@ const levels: TypographyLevels[] = [
"Heading 4",
"Heading 5",
"Body",
"Bold",
"Small",
];

Expand Down

0 comments on commit 2837d10

Please sign in to comment.