@alfheim/generator-nef-styles

0.2.1 • Public • Published

@alfheim/generator-nef-styles

Travis npm (scoped with tag) GitHub license PRs welcome

This package is part of the battery used to create new components for the Nasdaq Experience Framework. This package creates an <ComponentName>.styles.ts[x] file, which contains styles for the created component.

Note: It is recommended that you install and use generator-nef-component rather than installing this package directly, unless you need to modify the individual file generators.

By default, a stylesheet for the component named Test created using this generator looks as follows:

// todo: delete file if not needed
import styled from "styled-components";

const StyledTest = styled.div``;

export default StyledTest;

If you pass --enable-jsx when running this generator, your styles will be changed as follows:

// todo: delete file if not needed
import React from "react";
import styled from "styled-components";

const StyledTest = styled(({ ...props }) => <div {...props} />)``;

export default StyledTest;

The purpose of the alternative syntax above is to allow the prevention of props being passed all the way down to the DOM, potentially causing console errors.

Getting started

To install, simply run:

yarn add @alfheim/generator-nef-styles --dev

or

npm install @alfheim/generator-nef-styles --dev 

Contributing

We'd love to have your helping hand on alfheim! Go over to our issues section and see if there's anything we're looking for help with OR open up a PR if you have an idea for a way to improve the library.

License

Alfheim is open source software licensed as MIT.

Readme

Keywords

Package Sidebar

Install

npm i @alfheim/generator-nef-styles

Weekly Downloads

1

Version

0.2.1

License

MIT

Unpacked Size

7.24 kB

Total Files

6

Last publish

Collaborators

  • haldunanil