Skip to content

Commit acba6b8

Browse files
authored
feat: add scss handling to stencil plugin (#1846)
1 parent 3c9d4ad commit acba6b8

15 files changed

Lines changed: 104 additions & 5 deletions

File tree

packages/knip/fixtures/plugins/stencil/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@
22
"name": "@plugins/stencil",
33
"dependencies": {
44
"@stencil/core": "*"
5+
},
6+
"devDependencies": {
7+
"@stencil/sass": "*"
58
}
69
}

packages/knip/fixtures/plugins/stencil/src/components/ios.scss

Whitespace-only changes.

packages/knip/fixtures/plugins/stencil/src/components/md.scss

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
:host { display: inline-block; }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Component, h } from '@stencil/core';
22

3-
@Component({ tag: 'my-button' })
3+
@Component({ tag: 'my-button', styleUrl: 'my-button.scss' })
44
export class MyButton {
55
render() { return <button><slot /></button>; }
66
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
:host { direction: rtl; }
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
:host { display: block; }
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { Component, h } from '@stencil/core';
2+
3+
@Component({ tag: 'my-card', styleUrls: ['my-card.scss', 'my-card-rtl.scss'] })
4+
export class MyCard {
5+
render() { return <div class='card'><slot /></div>; }
6+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { Component, h } from '@stencil/core';
2+
3+
@Component({ tag: 'my-mode-style', styleUrls: {
4+
md: './ios.scss',
5+
ios: './md.scss'
6+
}})
7+
export class MyModeStyle {
8+
render() { return <div class='card'><slot /></div>; }
9+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
:host { display: block; }

0 commit comments

Comments
 (0)