Replies: 4 comments 8 replies
-
I am and I'm curious about how well the two will work together. I'm building a component library in stencil. It seems like the apps that consume my library will still need to handle css compilation, particularly when using the sprinkles api. |
Beta Was this translation helpful? Give feedback.
-
I managed to use
*
import { Config } from "@stencil/core";
import { vanillaExtractPlugin } from "@vanilla-extract/rollup-plugin";
import { reactOutputTarget } from "@stencil/react-output-target";
import { solidOutputTarget } from "stencil-solid-output-target";
export const config: Config = {
namespace: "example",
outputTargets: [
reactOutputTarget({
componentCorePackage: "./../../..",
proxiesFile: "./dist/react/src/index.ts",
includeDefineCustomElements: true,
}),
solidOutputTarget({
componentCorePackage: "./../../..",
proxiesFile: "./dist/solid/src/index.ts",
includeDefineCustomElements: true,
}),
{
type: "dist",
esmLoaderPath: "./loader",
},
{
type: "docs-readme",
},
],
rollupPlugins: {
before: [vanillaExtractPlugin()],
},
};
import { Component, Host, h } from "@stencil/core";
import { myComponentStyle } from "./my-component.css";
@Component({
tag: "my-component",
// shadow: false (already false by default)
})
export class MyComponent {
render() {
return (
<Host>
<div class={myComponentStyle}>Bonjour</div>
</Host>
);
}
}
import { style } from "@vanilla-extract/css";
export const myComponentStyle = style({
backgroundColor: "pink",
}); |
Beta Was this translation helpful? Give feedback.
-
I just published a plugin that allows you to use https://github.com/arthur-fontaine/stencil-vanilla-extract-plugin import { Component, h } from '@stencil/core';
import { button } from './button.css.ts';
@Component({
tag: 'demo-button',
styleUrls: ['button.css'],
})
export class Button {
render() {
return <button class={button}>Click me</button>;
}
} It works like the Sass plugin. It will generate a stylesheet and link it to the component. |
Beta Was this translation helpful? Give feedback.
-
I got those errors :
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Anyone working with stencil?
Beta Was this translation helpful? Give feedback.
All reactions