🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

babel-plugin-sass-export

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-sass-export

Convert imported SASS files to exported CSS string

latest
Source
npmnpm
Version
0.0.3
Version published
Maintainers
1
Created
Source

SASS Export

Babel Plugin

Simple Babel plugin to parse SASS files and export your styles as a string.

We use this at Mudano with Fractal to help document our design library UI React.

Installation

NB: not yet published to NPM

$ yarn add babel-plugin-sass-export --dev

Usage

Create your React component as you usually would and import your SASS files.

import './my-sass.scss';

function Component() {
    return <div className="my-class">My Component</div>;
}

export default Component;

The plugin converts your SASS into a CSS string. The string is exported with your component for use as you see fit.

const style = '.my-class{background:red}';
export { style };

function Component() {
    return <div className="my-class">My Component</div>;
}

export default Component;

Issues

This plugin is not designed for production use.

Bundling your SASS with something like Webpack is likely a better choice.

Feel free to report issues or add comments.

Keywords

babel

FAQs

Package last updated on 07 Jan 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