gucong3000 / postcss-jsx

PostCSS syntax for parsing CSS in JS literals
MIT License
76 stars 28 forks source link

Add support for lit-css #38

Closed web-padawan closed 5 years ago

web-padawan commented 6 years ago

lit-css is a new tool to distribute styles via ES modules. The syntax it uses is exactly the same as used by astroturf added by #37:

import { css } from 'lit-css';

export default css`
  .table {
    /* my default table styles */
  }
`;

Adding the support would allow us to process the CSS in tagged literals used by this library.

This is especially important, as lit-css does not extract styles into .css files, unlike most of tools using similar syntax do. Its output is used as a content for <style> tags used e.g. by lit-html.


This change is Reviewable

codecov[bot] commented 6 years ago

Codecov Report

Merging #38 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #38   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          12     12           
  Lines         403    403           
=====================================
  Hits          403    403
Impacted Files Coverage Δ
extract.js 100% <ø> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 8cb49e3...73e5a41. Read the comment docs.

web-padawan commented 6 years ago

Tested and confirmed to work in web-padawan/lit-css-sandbox@22058b1