Nail Polishing Minions

    laier
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.3 • Public • Published

    laier

    laier

    laier Demo npm

    Plugin to organize CSS z-index layers.

    Usage

    First configure the layers by assigning the available layers in their respective order starting from bottom to top.

    // index.ts
    import configureLayer from 'laier'
    
    export const Layer = configureLayer(['Base', 'Popup', 'Modal'])

    Then the layers can be imported anywhere and assigned to the z-index where needed.

    // markup/MyComponent.tsx
    import { Layer } from '../../index'
    
    export const MyComponent = () => <div style={{ zIndex: Layer.Popup }}>Hello World</div>

    When a new layer is needed it can be added into the initially configured order without having to adapt all other z-index's everywhere. Also, there is no need to calculate any numbers by hand and when TypeScript is used it will ensure only the available layers are used.

    Install

    npm i laier

    DownloadsWeekly Downloads

    2

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    2.94 kB

    Total Files

    5

    Last publish

    Collaborators

    • tobua