-
-
Notifications
You must be signed in to change notification settings - Fork 835
Allow generate new component with scss file instead of css #2155
Description
Stencil version:
@stencil/core@1.8.4
I'm submitting a:
[ ] bug report
[x ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://stencil-worldwide.herokuapp.com/ or https://forum.ionicframework.com/
Current behavior:
Can generate a new component with scss file instead of css
Expected behavior:
allow to generate a new component with a scss file and with the css file inside decorator
Steps to reproduce:
npm run generate
✔ Component tag name (dash-case): … my-component
✔ Which additional files do you want to generate? › Stylesheet, Spec Test, E2E Test
$ stencil generate super-component
The following files have been generated:
- src/components/component/my-component.tsx
- src/components/component/my-component.css
- src/components/component/my-component.spec.ts
- src/components/component/my-component.e2e.ts
Related code:
import { Component, Prop, h } from '@stencil/core';
import { format } from '../../utils/utils';
@Component({
tag: 'my-component',
styleUrl: 'my-component.css',
shadow: true
})
export class MyComponent {
/**
* The first name
*/
@Prop() first: string;
/**
* The middle name
*/
@Prop() middle: string;
/**
* The last name
*/
@Prop() last: string;
private getText(): string {
return format(this.first, this.middle, this.last);
}
render() {
return <div>Hello, World! I'm {this.getText()}</div>;
}
}Other information:
Here is the suggestion of simonhaenisch on slack https://stencil-worldwide.slack.com/archives/C79EANFL7/p1579693868137100