General Installation Configure Scheduled Updates List of Projects Supported Static Site Generators Fornax Common Erros Web Components Style nfdi-navbar nfdi-footer nfdi-body nfdi-sidebar-element nfdi-sidebar-eleneo nfdi-header nfdi-toc nfdi-code Development

Web Components

last updated at 2023-05-15 Style Based on Bulma

The DataPLANT web components were built with the basic Bulma style sheet in mind. It is highly recommended to reference the Bulma style sheet for all projects which use the DataPLANT web components.

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.4/css/bulma.min.css">

Or see here for the official docs.

Custom Properties - CSS variables

Nearly all web components come with the possibility to change the default color scheme by applying custom CSS variables to the html document. Each web component comes with a description of available variables and their default values. If you are using the nfdi-body for documentation it is highly recommended to use the following css snippet to apply a consistent styling to the child elements inside the body.

nfdi-toc, nfdi-body { --outside-background-color: rgb(240, 243, 246); --header-color: rgb(10, 12, 16) --element-text-color: #0E1116; --element-background-color: #fff; --accent-text-color: rgb(31, 194, 167); --link-color: #4FB3D9; --link-hover-color: #8ad3ee; } body { margin: 0px; } thead tr th, strong { color: var(--accent-text-color) !important } a { color: var(--link-color, #4FB3D9) !important; } a:hover { color: var(--link-hover-color, #3A3A3A) !important; } thead { font-size: 1.2rem; } nfdi-navbar <script type="text/plain"><nfdi-navbar></nfdi-navbar></script>

nfdi-navbar v0.8.0

Slotless component with responsive design at 1024px media query. Fixed top and requires padding-top: 3.25rem to be added to html.

<script type="text/plain"><html style="padding-top: 3.25rem"></html></script> Custom Properties nfdi-footer <script type="text/plain"><nfdi-footer></nfdi-footer></script>

nfdi-navbar v0.8.0

Slotless component.

Custom Properties nfdi-body <script type="text/plain"><nfdi-body [class="content"] [hassidebar="true"]></nfdi-body></script>

The top level container element for the main documentation design.

nfdi-body v0.5.2

This element will contain all documentation content in its "Main Content Area". To style it's children in this area, use the bulma class class="content".

Features

Slots

Child elements will go to "Main Content Area"

<nfdi-body class="content" hassidebar="true"> <h1 class="front-header">Index</h1> <i class="help">last updated at 2022-06-06</i> </nfdi-body> sidebar-slot

Use this slot to specify an nfdi-sidebar-element.

<nfdi-body class="content" hassidebar="true"> <!-- searchbar slot, pagefind example --> <div slot="searchbar"> <link href="/_pagefind/pagefind-ui.css" rel="stylesheet"> <script src="/_pagefind/pagefind-ui.js" type="text/javascript"></script> <div id="search"></div> <script> window.addEventListener('DOMContentLoaded', (event) => { new PagefindUI({ element: "#search" }); }); </script> </div> <!-- sidebar slot --> <nfdi-sidebar-element slot="sidebar" isactive="true"> <div slot="title">General</div> <h1 slot="inner"><a href="/index.html">Home</a></h1> </nfdi-sidebar-element> </nfdi-body> searchbar-slot

Use this slot to set an element above all sidebar links.

<nfdi-body class="content" hassidebar="true"> <!-- searchbar slot, pagefind example --> <div slot="searchbar"> <link href="/_pagefind/pagefind-ui.css" rel="stylesheet"> <script src="/_pagefind/pagefind-ui.js" type="text/javascript"></script> <div id="search"></div> <script> window.addEventListener('DOMContentLoaded', (event) => { new PagefindUI({ element: "#search" }); }); </script> </div> Html Attributes Custom Properties nfdi-sidebar-element <script type="text/plain"><nfdi-sidebar-element slot="sidebar" [isActive=true]></nfdi-sidebar-element></script>

Stackable element in "Sidebar Area> of body. MUST be slotted in "sidebar" slot of nfdi-body.

Features:

nfdi-sidebar-eleneo <nfdi-sidebar-eleneo slot="sidebar"> <a href="/">Theory</a> <a href="/#" slot="child">Metadata</a> <a href="/#what-is-metadata-amp-more" slot="child">What is metadata?</a> <a href="/#where-does-metadata-come-from" slot="child">Where does metadata come from?</a> <a href="/#why-do-i-benefit-from-metadata" slot="child">Why do I benefit from metadata?</a> <nfdi-sidebar-eleneo slot="child"> <a href="/#what-tasks-are-important-for-rich-metadata">What tasks are important for rich metadata?</a> <a href="/#collection" slot="child">Collection</a> <a href="/#structuring" slot="child">Structuring</a> <a href="/#sharing-and-curation" slot="child">Sharing and curation</a> </nfdi-sidebar-eleneo> </nfdi-sidebar-eleneo>

Stackable element in "Sidebar Area" of body. MUST be slotted in "sidebar" slot of nfdi-body.

nfdi-navbar v1.0.0

Features:

Slots <nfdi-sidebar-eleneo slot="child"> <a href="/#what-tasks-are-important-for-rich-metadata">What tasks are important for rich metadata?</a> <a href="/#collection" slot="child">Collection</a> <a href="/#structuring" slot="child">Structuring</a> <a href="/#sharing-and-curation" slot="child">Sharing and curation</a> </nfdi-sidebar-eleneo> main

Use this slot for the main link.

child-slot

Use this slot to create a toggable sub-container which contains child links.

Html Attributes Custom Properties nfdi-header <script type="text/plain"><nfdi-h1>Metadata</nfdi-h1> <nfdi-h2>Metadata 2</nfdi-h2> <nfdi-h3>Metadata 3</nfdi-h3> <nfdi-h4>Metadata 4</nfdi-h4> <nfdi-h5>Metadata 5</nfdi-h5> <nfdi-h6>Metadata 6</nfdi-h6></script>

nfdi-header

v0.5.2

Use with one child element as text. Will propagate html.

Features

Custom Properties nfdi-toc <script type="text/plain"><nfdi-toc></nfdi-toc></script>

nfdi-toc v0.5.2

Slotless component to automatically create table of contents.

Features

Known Issues

Custom Properties nfdi-code <script type="text/plain"><nfdi-code></nfdi-code></script>

nfdi-code v0.6.0

Example Mermaid Graph (>0.13.0)

pie title What Voldemort doesn't have? "FRIENDS" : 2 "FAMILY" : 3 "NOSE" : 45

This component can be used to display code snippets similar to <pre> html elements. Any text inside will be presented exactly as written.

Add class="language-*" to the element to specify the language for syntax highlighting.

👀 If you want to showcase html code, it is recommended to add a <script> tag.

<nfdi-code class="language-html"><script type="text/plain"><p>Hi!</p></script></nfdi-code>

Features

Slots <script type="text/plain"><nfdi-body> <nfdi-code class="language-fsharp">#r "nuget: DynamicObj, 1.0.1" #r "nuget: Expecto, 9.0.4" open DynamicObj open Newtonsoft.Json open System.IO open Microsoft.FSharp.Core type JsonParser = { TokenType: JsonToken Value: string option } with static member create tokenType value = { TokenType = tokenType Value = value }</nfdi-code> </nfdi-body></script> Custom Properties

DataPLANT Support

Besides these technical solutions, DataPLANT supports you with community-engaged data stewardship. For further assistance, feel free to reach out via our helpdesk or by contacting us directly .
Contribution Guide 📖
✏️ Edit this page