stencil-plugin-tss
The Stencil CSS in TS Plugin
Last updated a month ago by schadenn .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install stencil-plugin-tss 
SYNC missed versions from official npm registry.

stencil-plugin-css-in-ts

Repo based on @stencil/sass

This package is used to enable using *.ts files as styleUrl for Stencil components.

First, npm install within the project:

npm install stencil-plugin-tss --save-dev

Next, within the project's stencil.config.js file, import the plugin and add it to the config's plugins config:

stencil.config.ts

import { Config } from '@stencil/core';
import { tss } from 'stencil-plugin-tss';

export const config: Config = {
  plugins: [
    tss({
        logCssErrors: boolean,
        tssFileInfix: string
    })
  ]
};

During development, this plugin will kick-in for *tssFileInfix*.ts style urls, and precompile them to CSS.

HMR

For better hot-module-reloading currently the stencil compiler has to be modified slightly.

Run: node node_modules/stencil-plugin-tss/rewriteStencil.js

This will do the necessary modifications. I will open a feature-request in the official Stencil project to make this configurable.

Code Highlighting

For better usability install styled component plugin within your IDE:

You can then use: import { styled } from "stencil-plugin-tss"

And prefix all your template literal CSS strings with styled to get CSS highlighting and IntelliSense.

Related

Current Tags

  • 1.0.2                                ...           latest (a month ago)

8 Versions

  • 1.0.2                                ...           a month ago
  • 1.0.1                                ...           3 months ago
  • 1.0.0                                ...           5 months ago
  • 0.0.6                                ...           7 months ago
  • 0.0.5                                ...           7 months ago
  • 0.0.4                                ...           7 months ago
  • 0.0.3                                ...           7 months ago
  • 0.0.2                                ...           7 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 8
Last Day 0
Last Week 8
Last Month 16
Dependencies (14)
Dev Dependencies (8)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |