Skip to content

Working with unocss #2173

Open
Open
@darkyelox

Description

@darkyelox

Is your feature request related to a problem? Please describe.
I have tried to make this work with unocss and solidjs, the solid components are shown but no styles applied, my attempt was to use postcss plugin with unocss and created a postcss.config.js file:

wrapper.tsx file

import '../style.css'; 

import { JSX } from 'solid-js';

export const Wrapper = ({ children }: { children: JSX.Element }) => {
  return <div className="wrapped">{children}</div>;
};

postcss.config.js file

module.exports = {
  plugins: {
    '@unocss/postcss': {},
  },
};

style.css file:

@unocss;

I have noticed that somehow the plugin gets slow and if I play with the style.css file it may break and I have to close VSCode, kill all node processes and then start VSCode again.

Describe the solution you'd like
A guide of how to use unocss in all frameworks supported by previewjs.

Describe alternatives you've considered
For now I created a preview component for each component (in fact this is the one I want to preview in Previewjs) and created a global Preview component that import the preview file of each component dynamically ( I use a CLI command for select the preview file to import) and run a Vite server locally.

Additional context
I use Visual Studio code plugin.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions