npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@utrecht/badge-data-css

v1.2.0

Published

Badge data component for the Municipality of Utrecht based on the NL Design System architecture

Downloads

109

Readme

Data badge

HTML

Gebruik een inline HTML-element voor de badge component, zodat de badge binnen een p HTML-element gebruikt kan worden. Bijvoorbeeld een span, time of data element:

<p>
  Belangrijke gegevens: <span class="utrecht-badge-data">≥ 250㎡</span>
  <span class="utrecht-badge-data">Energielabel A</span>
</p>

Gebruik niet een div:

<p>Belangrijke gegevens: <div>≥ 250㎡</div> <div>Energielabel A</div></p>

Een div in een p element wordt door de parser gezien als het einde van een p element, waardoor je eigenlijk dit bereikt:

<p>Belangrijke gegevens:</p>
<div>≥ 250㎡</div>
<div>Energielabel A</div>
</p>

Computer-leesbare datum en tijd

Gebruik een time element wanneer je een datum of een datum en tijd hebt:

<time class="utrecht-badge-data" datetime="2038-01-19T03:14:08Z">19 januari 2038 om 03:14:08</time>

Gebruik een time element wanneer je een een tijdsduur hebt, in het datetime attribuut moet periode in ISO 8601 notatie.

<time class="utrecht-badge-data" datetime="PT1H39M">1 uur en 39 minuten</time>

Overige computer-leesbare data

Gebruik een data element wanneer je een value hebt met een waarde die voor de computer duidelijk is. De gewone tekst kan dan voor mensen leesbaar zijn. Je kunt de value bijvoorbeeld gebruiken om een tabel te sorteren op die waarde. Gebruik nooit een <data> element zonder value.

<tr>
  <th>Koningsweg 13</th>
  <td>
    <data class="utrecht-badge-data" value="259">≥ 250㎡</data>
  </td>
</tr>

CSS

Als je de data badge verschillende designs wilt geven, dan kan dat met eigen CSS. De data badge component heeft standaard maar design tokens voor een soort kleur. Je kunt een class name maken om de kleur aan te passen:

.utrecht-badge-data--myprefix-numeric {
  --utrecht-badge-background-color: var(--myprefix-color-blue);
  --utrecht-badge-color: var(--myprefix-color-offwhite);
}

.utrecht-badge-data--myprefix-date {
  --utrecht-badge-background-color: var(--myprefix-color-red);
  --utrecht-badge-color: var(--myprefix-color-offwhite);
}

Je kunt voor de modifier class name een eigen prefix gebruiken (zoals example-), zodat je er in de toekomst geen last van hebt als deze component toevallig een identieke uitbreiding krijgt.