Answers for "import scss variable to js create react app"

5

install scss in react js

$ npm install node-sass --save
$ # or
$ yarn add node-sass
Posted by: Guest on December-22-2020
1

react access scss variables

const appBarElement = document.querySelector('.appBar');
if (appBarElement) {
  const style = window.getComputedStyle(appBarElement);
  const position = style.getPropertyValue('position');
  console.log(position);
}
Posted by: Guest on July-16-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language