Skip to content

Commit

Permalink
Merge pull request #56 from it-at-m/55-mucintro-add-missing-pieces
Browse files Browse the repository at this point in the history
✨ add tagline and divider to MucIntro
  • Loading branch information
FabianWilms authored May 8, 2024
2 parents 3c1bbae + fbcc676 commit 7fb8b08
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 10 deletions.
1 change: 1 addition & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import "../public/assets/temporary/muenchende-style.css";
import "../public/assets/temporary/custom-style.css";
import "../public/assets/temporary/muenchende-fontfaces.css";

/** @type { import('@storybook/vue3').Preview } */
Expand Down
1 change: 1 addition & 0 deletions docs/GettingStarted.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ In your Webcomponents root you should import the MDE5-CSS and SVG-Sprite for MDE

<style>
@import "@muenchen/muc-patternlab-vue/dist/assets/temporary/muenchende-style.css";
@import "@muenchen/muc-patternlab-vue/dist/assets/temporary/custom-style.css";
</style>
```

Expand Down
19 changes: 19 additions & 0 deletions public/assets/temporary/custom-style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* We need this css to ensure the correct patternlab
* behaviour inside of a webcomponent.
*/
:root {
--color-brand-main-blue: #005A9F;
--color-neutrals-blue: #BDD4EA;
--color-neutrals-blue-xlight: #F2F6FA;
--color-neutrals-grey: #3A5368;
color: var(--color-neutrals-grey);
font-family: Open Sans, Arial, sans-serif;
font-size: 1rem;
font-weight: 400;
line-height: 1.5;
word-break: break-word;
background-color: #fff;
-webkit-text-size-adjust: 100%;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
11 changes: 10 additions & 1 deletion src/components/Intro/MucIntro.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,18 @@ Used e.g. in https://stadt.muenchen.de/buergerservice/anliegen.html.

export const Default = {
args: {
title: "Intro-Title",
tagline: "Tagline",
title: "Intro with Title",
divider: true,
default:
"Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.\n" +
" Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.",
},
};

export const Minimal = {
args: {
title: "Smaller Intro with Title",
default: Default.args.default,
},
};
48 changes: 39 additions & 9 deletions src/components/Intro/MucIntro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ defineProps<{
* Title of the Intro
*/
title: string;
/**
* Tagline of the Intro (above the title)
*/
tagline: string;
/**
* Toggle to show a divider between title and body
*/
divider: boolean;
}>();
defineSlots<{
Expand All @@ -15,18 +23,40 @@ defineSlots<{
</script>

<template>
<div class="m-intro m-intro-summary-text">
<div class="container">
<div class="m-intro-summary-text__body">
<div class="m-intro-summary-text__grid">
<div class="m-intro-summary-text__content">
<h1 class="m-intro-summary-text__title">{{ title }}</h1>
<p>
<slot></slot>
</p>

<div class="m-intro m-intro-vertical">
<div class="m-intro-vertical__body">
<div class="container">
<div class="m-intro-vertical__grid">
<div class="m-intro-vertical__grid-inner">
<span v-if="tagline" class="m-intro-vertical__tagline">
{{ tagline }}
</span>

<h1 class="m-intro-vertical__title">
{{ title }}
</h1>

<div v-if="divider" class="ticket-divider"></div>

<div class="m-intro-vertical__content">
<p>
<slot></slot>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</template>

<style scoped>
.ticket-divider {
align-self: stretch;
height: 0;
border: 1px var(--color-neutrals-blue) solid;
margin-top: 8px;
margin-bottom: 16px;
}
</style>

0 comments on commit 7fb8b08

Please sign in to comment.