Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: logo web component #244

Merged
merged 3 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .htmlvalidate.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"root": true,
"extends": ["html-validate:recommended"],
"rules": {
"doctype-style": "off",
"no-inline-style": "off",
"void-style": "off"
}
Expand Down
1 change: 1 addition & 0 deletions packages/web-components-stencil/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Ignore generated files from Stencil
dist/
loader/
www/
31 changes: 31 additions & 0 deletions packages/web-components-stencil/src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!doctype html>
<!--
Start this Stencil development page using:

`pnpm run start`

-->
<html lang="en" dir="ltr" class="rhc-theme">
<head>
<meta charset="utf-8" />
<title>Web Components example</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0" />
<link rel="stylesheet" href="https://unpkg.com/@rijkshuisstijl-community/design-tokens/dist/index.css" />
<script
src="https://unpkg.com/@utrecht/web-component-library-stencil/dist/utrecht/utrecht.esm.js"
type="module"
></script>
<script type="module" src="/build/rhc.esm.js"></script>
<script nomodule src="/build/rhc.js"></script>
</head>
<body>
<rhc-logo
organisation="Rijksinstituut voor Volksgezondheid en Milieu"
subtitle="Ministerie van Volksgezondheid,
Welzijn en Sport"
></rhc-logo>
<utrecht-button
><utrecht-icon> <rhc-icon-info></rhc-icon-info> </utrecht-icon>Info</utrecht-button
>
</body>
</html>
47 changes: 47 additions & 0 deletions packages/web-components-stencil/src/logo.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/**
* @license EUPL-1.2
* Copyright (c) 2021 Community for NL Design System
*/

.rhc-logo {
--_rhc-logo-emblem-inline-size: var(--rhc-logo-emblem-inline-size, calc(var(--rhc-logo-font-size, 1em) * 3.1415));

color: var(--rhc-logo-color);
display: grid;
font-family: var(--rhc-logo-font-family);
font-size: var(--rhc-logo-font-size, 1em);
gap: 0 var(--rhc-logo-gap, calc(var(--_rhc-logo-emblem-inline-size) / 4));
grid-auto-rows: var(--_rhc-logo-emblem-inline-size);
grid-template-areas: ". emblem ." ". emblem wordmark";
grid-template-columns: 1fr var(--_rhc-logo-emblem-inline-size) 1fr;
grid-template-rows: 1fr var(--_rhc-logo-emblem-inline-size);
line-height: var(--rhc-logo-line-height, 1);
min-block-size: calc(var(--rhc-logo-rows, 2) * var(--_rhc-logo-emblem-inline-size));
}

.rhc-logo__emblem {
align-items: center;
background-color: var(--rhc-logo-emblem-background-color);
block-size: 100%;
display: flex;
flex-direction: column;
grid-area: emblem;
justify-content: end;
}

.rhc-logo__wordmark {
grid-area: wordmark;
max-inline-size: calc(210 / 14 * var(--rhc-logo-font-size, 1em));
}

.rhc-logo__subtitle {
font-style: italic;
}

.rhc-logo__title,
.rhc-logo__subtitle {
/* reset margin of HTML <p> element */
margin-block-end: 0;
margin-block-start: 0;
white-space: pre-line;
}
Loading
Loading