opencomponents / oc-template-react

⚛️ Module for handling React templates in OC
MIT License
23 stars 16 forks source link

Add SASS support to the oc-template-react-compiler webpack. #516

Closed kenhkelly closed 4 years ago

kenhkelly commented 5 years ago

image

Usage:

app.js

import React from "react";
import styles from "./styles.css";
import sass from "./styles.scss";

const App = props =>
  <div className={styles.special}>
    <h1 className={`${sass.heading} ${styles.heading}`}>
      Hello {props.name}
    </h1>
  </div>;

export default App;

styles.scss

body {
  h1 {
    background: yellow;
  }
  .heading {
    font-size: 15em;
  }
}

Also plays nicely with existing css

styles.css

.heading {
  text-decoration: underline;
}
codecov[bot] commented 5 years ago

Codecov Report

Merging #516 into master will increase coverage by 0.04%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #516      +/-   ##
==========================================
+ Coverage   96.04%   96.09%   +0.04%     
==========================================
  Files          19       19              
  Lines         253      256       +3     
  Branches       31       31              
==========================================
+ Hits          243      246       +3     
  Misses         10       10
Impacted Files Coverage Δ
...-utils/oc-webpack/lib/configurator/client/index.js 100% <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 e69ae35...93c4290. Read the comment docs.

codecov[bot] commented 5 years ago

Codecov Report

Merging #516 into master will increase coverage by 0.04%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #516      +/-   ##
==========================================
+ Coverage   96.04%   96.09%   +0.04%     
==========================================
  Files          19       19              
  Lines         253      256       +3     
  Branches       31       31              
==========================================
+ Hits          243      246       +3     
  Misses         10       10
Impacted Files Coverage Δ
...-utils/oc-webpack/lib/configurator/client/index.js 100% <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 7f4901c...c9ae840. Read the comment docs.

kenhkelly commented 5 years ago

@matteofigus Yeah we could do that. I was thinking to leave both there in case you needed some css based library to be compiled, but the sass-loader might actually take care of that. Let me take a look at adding this new package (and incorporating your comment)

kenhkelly commented 4 years ago

Closing for now to move to another package in the future.