Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add warning about importing CSS in Angular CLI projects #3022

Merged
merged 4 commits into from
Feb 19, 2018
Merged

Add warning about importing CSS in Angular CLI projects #3022

merged 4 commits into from
Feb 19, 2018

Conversation

jonrimmer
Copy link
Contributor

The changes in #2735 mean that the CSS loader is not available when creating a storybook for an Angular CLI project, so CSS cannot be imported directly within a story with using the inline loader syntax.

What I did

Added a note to the docs.

How to test

  1. yarn docs:dev
  2. Check the configurations/default-config page.

The changes in #2735 mean that the CSS loader is not available when creating a storybook for an Angular CLI project, so CSS cannot be imported directly within a story with using the inline loader syntax.
@@ -56,6 +56,11 @@ import './styles.css';

> **Note:** this is plain CSS only. If you need a preprocessor like SASS, you need to [customize the webpack config](/configurations/custom-webpack-config/).

> **Warning:** storybooks for projects that use Angular CLI must use the inline loader syntax:
> ```js
> import '!style-loader!css-loader!./styles.css';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say that this is also available by adding an extra rule to the extended webpack config.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean like you talked about here? Is this really something we want to explicitly recommend? It relies on manipulating rules that are part of the private Angular CLI implementation, and could break if Angular changes something.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think bringing here a concrete example is not needed. Just to mention about a feature storybook has (extended webpack config). I think that people just need to know about all the possibilities they have.

@codecov
Copy link

codecov bot commented Feb 19, 2018

Codecov Report

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

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #3022   +/-   ##
======================================
  Coverage    37.3%   37.3%           
======================================
  Files         435     435           
  Lines        9427    9427           
  Branches      904     908    +4     
======================================
  Hits         3517    3517           
+ Misses       5391    5370   -21     
- Partials      519     540   +21
Impacted Files Coverage Δ
app/vue/src/server/utils.js 0% <0%> (-100%) ⬇️
app/react/src/server/babel_config.js 0% <0%> (-76.67%) ⬇️
addons/info/src/components/PropVal.js 84.25% <0%> (ø) ⬆️
.../ui/components/stories_panel/stories_tree/index.js 38.73% <0%> (ø) ⬆️
lib/ui/src/modules/shortcuts/actions/shortcuts.js 22.41% <0%> (ø) ⬆️
lib/ui/src/libs/withLifecycleDecorator.js 17.14% <0%> (ø) ⬆️
app/react-native/src/bin/storybook-build.js 0% <0%> (ø) ⬆️
addons/knobs/src/angular/utils.js 82.14% <0%> (ø) ⬆️
addons/storyshots/src/angular/renderTree.js 61.9% <0%> (ø) ⬆️
lib/ui/src/modules/ui/routes.js 0% <0%> (ø) ⬆️
... and 66 more

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 a1229bb...5f9d34a. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants