atomicojs / atomico

Atomico a micro-library for creating webcomponents using only functions, hooks and virtual-dom.
https://atomicojs.dev
MIT License
1.15k stars 43 forks source link

sass or other css preprocessor support #104

Open DanavsSite opened 1 year ago

DanavsSite commented 1 year ago

Is your feature request related to a problem? Please describe. no

Describe the solution you'd like i think it'd if we can just import them like 'import "./hello.css"'

UpperCod commented 1 year ago

Hi @DanavsSite, I find the functionality you mentioned interesting. I believe we should include it in the @atomico/vite package. I have an idea for a syntax like this:

import style from ‘./style.css?atomico’;

function component(){...}

component.styles = style;

Option 2 involves automatic association, but it requires AST analysis of the code:

import ‘./style.css?atomico’;

function component(){...}

This implies more advanced processing that can automatically determine the relationship between the CSS file and the component, without the need to manually assign the styles variable as in option 1.

Good idea, I'll see if I can work on it