1.0.5 • Published 2 years ago

grid-template v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

grid-template

Webcomponent that abstract grid-template-areas boilerplate!

Installation

yarn add grid-template
import "grid-template";

Example

Turn this

  <grid-template
    debug
    columns="minmax(15rem, 25%) auto"
    rows="3rem auto 3rem"
    .areas=${[
      "header header",
      "sidebar main",
      "footer footer"
    ]}
    .hostStyles=${css`
      :host {
        width: 100vw;
        height: 100vh;
      }
    `}
  >
    <div slot="header">Header</div>
    <div slot="sidebar">Sidebar</div>
    <div slot="main">Main</div>
    <div slot="footer">Footer</div>
  </grid-template>

into this

screenshot

API

  @property({ type: Boolean })
  debug = false;

  @property({ type: String })
  columns!: string;

  @property({ type: String })
  rows!: string;

  @property({ type: Array })
  areas!: string[];

  @property({ type: Array })
  hostStyles: CSSResult[] | CSSResult = [];

  @property()
  ignore: string[] | string = [];

TODO

  • Guard each property separately, to allow for somewhat cheap update
1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago