unocss / unocss

The instant on-demand atomic CSS engine.
https://unocss.dev
MIT License
16.29k stars 820 forks source link

Angular14 for unocss #1874

Closed sixinyiyu closed 1 year ago

sixinyiyu commented 1 year ago

how to use unocss with angular 14, without vite

sadeghbarati commented 1 year ago

use UnoCSS cli

https://github.com/unocss/unocss/issues/1842

sixinyiyu commented 1 year ago

i want to use Tailwind CSS

itpropro commented 1 year ago

The @unocss/cli package has everything you need to use TailwindCSS syntax.

sixinyiyu commented 1 year ago

1、

 npm -i  -D unocss @unocss/webpack

version : 0.46.5

2、config webpack.config.js

const UnoCSS = require('@unocss/webpack').default

module.exports = {
  plugins: [
    UnoCSS({ /* options */ }),
  ],
  optimization: {
    realContentHash: true,
  },
}

3、 add uncoss config

import {
    defineConfig,
    presetAttributify,
    presetIcons,
    presetUno,
  } from 'unocss'

  export default defineConfig({
    rules: [
      ['custom-rule', { color: 'red' }]
    ],
    shortcuts: {
      'custom-shortcut': 'text-lg text-orange hover:text-teal'
    },
    presets: [
      presetUno(),
      presetAttributify(),
      presetIcons({
        scale: 1.2,
        cdn: 'https://esm.sh/'
      }),
    ]
  })

4、import 'uno.css'

try import at main.ts or gloabl style.css 

result: it's not work

Shyam-Chen commented 1 year ago

Use @nitedani/vite-plugin-angular

sadeghbarati commented 1 year ago

https://analogjs.org/

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.