Skip to content

Commit

Permalink
remove styles from components
Browse files Browse the repository at this point in the history
  • Loading branch information
cal-smith committed Aug 7, 2018
1 parent ef77164 commit cdb776c
Show file tree
Hide file tree
Showing 19 changed files with 33 additions and 59 deletions.
4 changes: 4 additions & 0 deletions .storybook/config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { configure } from "@storybook/angular";

// load global styles
require("!style-loader!css-loader!sass-loader!./preview.scss");

require("../src/index.stories");
// automatically import all files ending in *.stories.ts
const req = require.context("../src", true, /.stories.ts$/);
function loadStories() {

req.keys().forEach(filename => {
if (!filename.includes("index")) { req(filename) }
});
Expand Down
11 changes: 0 additions & 11 deletions .storybook/notwebpack.config.js

This file was deleted.

5 changes: 5 additions & 0 deletions .storybook/preview.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@import "~carbon-components/scss/globals/scss/styles.scss";

body {
margin: 20px;
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"rxjs": "6.2.2",
"sass-loader": "7.0.1",
"semantic-release": "^15.9.3",
"style-loader": "0.21.0",
"style-loader": "^0.21.0",
"stylelint": "8.4.0",
"stylelint-webpack-plugin": "0.10.4",
"svgxuse": "1.2.6",
Expand Down
3 changes: 1 addition & 2 deletions src/dropdown/dropdown.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ import { position } from "../utils/position";
useExisting: Dropdown,
multi: true
}
],
styleUrls: [ "./dropdown.scss" ]
]
})
export class Dropdown implements OnInit, AfterContentInit, OnDestroy {
/**
Expand Down
2 changes: 0 additions & 2 deletions src/dropdown/dropdown.scss

This file was deleted.

3 changes: 1 addition & 2 deletions src/dropdown/list/dropdown-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ import { ScrollableList } from "./../scrollable-list.directive";
provide: AbstractDropdownView,
useExisting: DropdownList
}
],
styleUrls: ["./dropdown-list.scss"]
]
}) // conceptually this extends list-group, but we dont have to
export class DropdownList implements AbstractDropdownView, AfterViewInit, OnChanges, OnDestroy {
/**
Expand Down
6 changes: 0 additions & 6 deletions src/dropdown/list/dropdown-list.scss

This file was deleted.

3 changes: 1 addition & 2 deletions src/forms/checkbox.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ export class CheckboxChange {
multi: true
}
],
changeDetection: ChangeDetectionStrategy.OnPush,
styleUrls: [ "./../../node_modules/carbon-components/scss/components/checkbox/_checkbox.scss" ]
changeDetection: ChangeDetectionStrategy.OnPush
})
export class CheckboxComponent implements ControlValueAccessor, AfterViewInit {
/**
Expand Down
3 changes: 1 addition & 2 deletions src/forms/forms.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ storiesOf("Forms", module).addDecorator(
Some Title
<input type="text" class="bx--text-input" placeholder="Optional placeholder text">
</ibm-label>
`,
styleUrls: ["./../../node_modules/carbon-components/scss/components/text-input/_text-input.scss"]
`
}))
.add("Switch", () => ({
template: `<ibm-switch></ibm-switch>`
Expand Down
3 changes: 1 addition & 2 deletions src/forms/label.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ import { Component, Input, AfterContentInit, ElementRef } from "@angular/core";
<label [for]="labelInputID" class="bx--label"><ng-content></ng-content></label>
<ng-content select="input,textarea,div"></ng-content>
</div>
`,
styleUrls: ["./../../node_modules/carbon-components/scss/components/form/_form.scss"]
`
})
export class LabelComponent implements AfterContentInit {
/**
Expand Down
3 changes: 1 addition & 2 deletions src/forms/radio.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ export class RadioChange {
useExisting: RadioGroup,
multi: true
}
],
styleUrls: ["./../../node_modules/carbon-components/scss/components/radio-button/_radio-button.scss"]
]
})
export class RadioGroup implements OnInit, AfterContentInit, ControlValueAccessor {
/**
Expand Down
3 changes: 1 addition & 2 deletions src/forms/switch.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ export class SwitchChange {
useExisting: SwitchComponent,
multi: true
}
],
styleUrls: ["./../../node_modules/carbon-components/scss/components/toggle/_toggle.scss"]
]
})
export class SwitchComponent extends CheckboxComponent implements OnInit {
/**
Expand Down
20 changes: 8 additions & 12 deletions src/index.stories.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import { storiesOf, moduleMetadata } from "@storybook/angular";
import { Welcome } from "@storybook/angular/demo";
import { storiesOf } from "@storybook/angular";

storiesOf("Welcome", module).add("to Storybook", () => ({
component: Welcome,
// import "carbon-components/scss/globals/scss/styles.scss";

storiesOf("Welcome", module).add("to Carbon Angular", () => ({
template: `
<h1>Carbon Components Angular</h1>
<h2>An Angular implementation of the Carbon Design System</h2>
`,
props: {},
}));

// storiesOf("Another Button", module).add("button with link to another story", () => ({
// component: Button,
// props: {
// text: "Go to Welcome Story",
// onClick: linkTo("Welcome"),
// },
// }));
3 changes: 1 addition & 2 deletions src/modal/modal-footer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { Component } from "@angular/core";
<footer role="contentinfo" class="bx--modal-footer">
<ng-content></ng-content>
</footer>
`,
styleUrls: ["./../../node_modules/carbon-components/scss/components/modal/_modal.scss"]
`
})
export class ModalFooterComponent {}
3 changes: 1 addition & 2 deletions src/modal/modal-header.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ import { Component, Output, EventEmitter, Input } from "@angular/core";
</button>
</header>
`,
styleUrls: ["./../../node_modules/carbon-components/scss/components/modal/_modal.scss"]
`
})
export class ModalHeaderComponent {
/**
Expand Down
3 changes: 1 addition & 2 deletions src/modal/modal.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ import { cycleTabs } from "./../common/tab.service";
animate(200, style({transform: "translate(0, 5%)", opacity: 0}))
])
])
],
styleUrls: ["./../../node_modules/carbon-components/scss/components/modal/_modal.scss"]
]
})
export class ModalComponent implements OnInit, OnDestroy {
/**
Expand Down
9 changes: 4 additions & 5 deletions src/modal/modal.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ import { Modal, ModalService } from "../";
<button class="bx--btn bx--btn--primary" (click)="closeModal()">Close</button>
</ibm-modal-footer>
</ibm-modal>
`,
styleUrls: ["./../../node_modules/carbon-components/scss/components/modal/_modal.scss"]
`
})
class SampleModalComponent {
modalText: string;
Expand All @@ -37,8 +36,7 @@ class SampleModalComponent {
selector: "app-modal-story",
template: `
<button class="bx--btn bx--btn--primary" (click)="openModal()">Open Modal</button>
`,
styleUrls: ["./../../node_modules/carbon-components/scss/components/button/_button.scss"]
`
})
class ModalStory {

Expand Down Expand Up @@ -77,4 +75,5 @@ storiesOf("Modal", module)
<app-modal-story></app-modal-story>
<ibm-modal-placeholder></ibm-modal-placeholder>
`
}));
}
));
3 changes: 1 addition & 2 deletions src/modal/overlay.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ import {
#overlay>
<ng-content></ng-content>
</section>
`,
styleUrls: ["./../../node_modules/carbon-components/scss/components/modal/_modal.scss"]
`
})
export class OverlayComponent {
/**
Expand Down

0 comments on commit cdb776c

Please sign in to comment.