Skip to content

Commit

Permalink
add example stories to test styles pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
Quramy committed Jan 12, 2018
1 parent 3ad322f commit b91744c
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.red-color {
color: red;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<div>
<p class="red-color">Styled with scoped CSS</p>
<p class="blue-color">Styled with scoped SCSS</p>
<p class="green-color">Styled with global CSS</p>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
div {
p.blue-color {
color: blue;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { storiesOf } from '@storybook/angular';
import { StyledComponent } from './styled.component';

storiesOf('Component styles', module).add('Component with styles', () => ({
component: StyledComponent,
}));
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Component } from '@angular/core';

@Component({
selector: 'storybook-styled-component',
templateUrl: './styled.component.html',
styleUrls: ['./styled.component.css', './styled.component.scss'],
})
export class StyledComponent {}
4 changes: 4 additions & 0 deletions examples/angular-cli/src/styles.css
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
/* You can add global styles to this file, and also import other style files */

.green-color {
color: green;
}

0 comments on commit b91744c

Please sign in to comment.