New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@erect/css-loader

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@erect/css-loader

Erect CSS Loader

Source
npmnpm
Version
0.0.95
Version published
Weekly downloads
14
600%
Maintainers
1
Weekly downloads
 
Created
Source

Erect Logo Erect Animation

CSS Loader for Erect

It loads your CSS isomorphically between server and client using Erect DocumentState manager

Key aspacts

  • Generates CSS files with File Loader
  • Uses Webpack CSS Loader under the hood
  • Generates typings for your CSS

Typings

/* Header.css */
.header {
  background-color: green;
}

.header h4 {
  font-weight: bold;
}

.header .side-nav {
  font-weight: bold;
}
// Header.d.ts
import { RenderRequest } from '@erect/core';

export const loadStyles: (req: RenderRequest) => void;

export interface IHeaderCss {
  header: string;
  'side-nav': string;
  sideNav: string;
}

export const getStyles: (req: RenderRequest) => IHeaderCss;

Usage

import '@erect/static';
import { mount } from '@erect/core';
import headerCss from './header.css';

mount()
  .render((req) => {
    const styles = headerCss.getStyles(req);
    return req.renderStatic(req.html `
      <header class="${styles.header}">
        <nav class=${styles.navBar}>
          <ul>
            <li>item</li>
          </ul>
        </nav>
      </header>
    `);
  });  

Options

typings boolean

It's true by default, it generates typings and emit generated css files, make sure to use this only when targeting client

file object

Pass File Loader options

css object

Pass CSS Loader options

use array

Pass an array of loaders to process module after CSS Loader and before File Loader

silent boolean

No log output

typingsBanner string

Append a banner message to generated typings

FAQs

Package last updated on 08 Dec 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts