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

holy-grail-layout

v2.1.1

Published

Provides an extended "Holy Grail" layout as a web component.

Downloads

20

Readme

Holy-Grail Layout

npm Dependency status Published on webcomponents.org

Provides an extended "Holy Grail" layout as a web component.

Features:

Synopsis

<holy-grail>
  <header slot="head">...</header>
  <nav slot="nav-top">...</nav>
  <main slot="main">...</main>
  <nav slot="nav-bottom">...</nav>
  <aside slot="side-start">...</aside>
  <aside slot="side-end">...</aside>
  <footer slot="foot">...</footer>
</holy-grail>
<script defer src=https://unpkg.com/[email protected]/dist/index.min.js></script>

Complete Layout

Installation

Make sure that you have installed Node.js. Use your favourite package manager (NPM, Yarn or PNPM) to add the holy-grail-layout module to your project. Add -D on the command line if you use a bundler:

npm i holy-grail-layout
yarn add holy-grail-layout
pnpm i holy-grail-layout

If you write a plain HTML page, insert the holy-grail-layout script pointing either to CDN or to the local filesystem:

<script src=https://unpkg.com/[email protected]/dist/index.min.js></script>
<script src=node_modules/holy-grail-layout/dist/index.min.js></script>

Elements

holy-grail

The custom element holy-grail renders a "Holy Grail" layout in its shadow root and populates its parts from teh corresponding slots.

<holy-grail>...</holy-grail>

Attributes

| Name | Type | Description | |------|--------|--------------------------------------------------------------------------------------------------------| | size | string | Disables the responsive behaviour by forcing the screen width to be detected as small, medium or large. |

The width breakpoint between small and medium sizes is 480px. The width breakpoint between medium and large sizes is 768px.

Slots

| Name | Description | |------------|-----------------------------------------------------------------------------------------------| | head | Topmost horizontal slot, as wide as the whole element, as high as its content. | | nav-top | A horizontal slot above the "main" slot, as wide as the "main" slot, as high as its content. | | main | A large slot in the middle of the element, fills the rest of width and height of the element. | | nav-bottom | A horizontal slot below the "main" slot, as wide as the "main" slot, as high as its content. | | side-start | A vertical slot on the left side(in the left-to-right text-writing direction) with an explicit width (25% of the element by default), as high as the content between the "head" and "foot" slots. The width can be customised by a style using the part "side-start" in the selector. | | side-end | A vertical slot on the right side (in the left-to-right text-writing direction) with an explicit width (25% of the element by default), as high as the content between the "head" and "foot" slots. The width can be customised by a style using the part "side-end" in the selector. | | foot | Bottommost horizontal slot, as wide as the whole element, as high as its content. |

Styles

CSS variables --holy-grail-side-start-width and --holy-grail-side-end-width can be used to set the widths of the slots side-start and side-end. The default values are 25%.

holy-grail {
  --holy-grail-side-start-width: 33%;
}

Parts main, side-start and side-end can be used for advanced styling of the stretchable slots of the layout:

holy-grail::part(side-start) {
  width: 33%;
}

Examples

All slots populated, screen wider than 767px, see the source:

<holy-grail>
  <header slot="head">...</header>
  <nav slot="nav-top">...</nav>
  <main slot="main">...</main>
  <nav slot="nav-bottom">...</nav>
  <aside slot="side-start">...</aside>
  <aside slot="side-end">...</aside>
  <footer slot="foot">...</footer>
</holy-grail>

Complete Layout, Large

All slots populated, screen wider than 479px, but narrower than 768px:

Complete Layout, Middle

All slots populated, screen narrower than 480px:

Complete Layout, Small

Only some slots populated, screen wider than 767px, see the source:

<holy-grail>
  <header slot="head">...</header>
  <nav slot="nav-top">...</nav>
  <main slot="main">...</main>
  <nav slot="nav-bottom">...</nav>
  <aside slot="side-start">...</aside>
</holy-grail>

Partial Layout, Large

Only some slots populated, screen wider than 479px, but narrower than 768px:

Partial Layout, Middle

Only some slots populated, screen narrower than 480px:

Partial Layout, Small

IntelliSense

The language support in the VS Code editor can offer auto-completion and hover information for custom elements. To enable this feature for custom elements in this package, insert the following property to settings.json:

"html.customData": ["node_modules/holy-grail-layout/dist/html-custom-data.json"]

You will need to restart the VS Code to have this change applied.

License

Copyright (c) 2023 Ferdinand Prantl

Licensed under the MIT license.