-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor list-description component to handle
multiple values + Refactor list-description css I need a slightly different visual presentation for the list description on the event page, so I have changed the original CSS class to be able to add a BEM modifier: `.list-description--event`
- Loading branch information
1 parent
00ec24b
commit 0020787
Showing
4 changed files
with
66 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 9 additions & 9 deletions
18
src/stories/Library/Lists/list-description/ListDescriptionFakeData.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
import { ListData } from "./ListDescription"; | ||
|
||
const fakeData: ListData = { | ||
Type: { value: "Bog", type: "standard" }, | ||
Sprog: { value: "Dansk", type: "standard" }, | ||
Bidragsydere: { value: "Karsten Sand Iversen", type: "link" }, | ||
Originaltitel: { value: "Ulysses (1922)", type: "standard" }, | ||
ISBN: { value: "9788763814584", type: "standard" }, | ||
Udgave: { value: "Udgave, 2. oplag (2015)", type: "standard" }, | ||
Omfang: { value: "795 sider", type: "standard" }, | ||
Forlag: { value: "Rosinante", type: "standard" }, | ||
Målgruppe: { value: "Voksenmateriale", type: "standard" }, | ||
Type: { value: ["Bog"], type: "standard" }, | ||
Sprog: { value: ["Dansk"], type: "standard" }, | ||
Bidragsydere: { value: ["Karsten Sand Iversen"], type: "link" }, | ||
Originaltitel: { value: ["Ulysses (1922)"], type: "standard" }, | ||
ISBN: { value: ["9788763814584"], type: "standard" }, | ||
Udgave: { value: ["Udgave, 2. oplag (2015)"], type: "standard" }, | ||
Omfang: { value: ["795 sider"], type: "standard" }, | ||
Forlag: { value: ["Rosinante"], type: "standard" }, | ||
Målgruppe: { value: ["Voksenmateriale"], type: "standard" }, | ||
}; | ||
|
||
export default fakeData; |
54 changes: 39 additions & 15 deletions
54
src/stories/Library/Lists/list-description/list-description.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,54 @@ | ||
dl.list-description { | ||
@extend %text-small-caption; | ||
|
||
color: $c-text-secondary-gray; | ||
display: flex; | ||
flex-flow: column; | ||
|
||
& > div { | ||
display: flex; | ||
flex-flow: row wrap; | ||
// Todo: This "> div" selector should be removed and instead use the class .list-description__item in the markup in dpl-react project | ||
& > div, | ||
.list-description__item { | ||
display: grid; | ||
grid-template-columns: 1fr 2fr; | ||
} | ||
|
||
dt { | ||
flex-basis: 18%; | ||
dt, | ||
dd { | ||
padding: 2px 4px; | ||
} | ||
|
||
dd { | ||
flex-basis: 72%; | ||
flex-grow: 1; | ||
margin: 0; | ||
padding: 2px 4px; | ||
display: grid; | ||
@include breakpoint-s { | ||
display: flex; | ||
flex-wrap: wrap; | ||
gap: $s-sm; | ||
} | ||
} | ||
.link-tag { | ||
@extend %text-small-caption; | ||
color: $c-text-primary-black; | ||
} | ||
} | ||
|
||
dl.list-description.list-description--event { | ||
height: max-content; | ||
display: grid; | ||
grid-template-columns: repeat(2, 1fr); | ||
gap: $s-md; | ||
align-items: start; | ||
|
||
.list-description__item { | ||
grid-template-columns: 1fr; | ||
} | ||
|
||
dd { | ||
font-weight: bold; | ||
} | ||
|
||
.link-tag { | ||
@extend %text-small-caption; | ||
@include breakpoint-s { | ||
grid-template-columns: 1fr; | ||
gap: $s-xs; | ||
|
||
color: $c-text-primary-black; | ||
.list-description__item { | ||
grid-template-columns: 1fr 2fr; | ||
} | ||
} | ||
} |