-
-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add example stories to test styles pattern
- Loading branch information
Showing
6 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
examples/angular-cli/src/stories/component-with-style/styled.component.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.red-color { | ||
color: red; | ||
} |
5 changes: 5 additions & 0 deletions
5
examples/angular-cli/src/stories/component-with-style/styled.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
5 changes: 5 additions & 0 deletions
5
examples/angular-cli/src/stories/component-with-style/styled.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
div { | ||
p.blue-color { | ||
color: blue; | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
examples/angular-cli/src/stories/component-with-style/styled.component.stories.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
})); |
8 changes: 8 additions & 0 deletions
8
examples/angular-cli/src/stories/component-with-style/styled.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |