Coder Social home page Coder Social logo

Comments (6)

zguolee avatar zguolee commented on May 30, 2024

Thanks for asking, but I can't reproduce this problem, can you give me the source code of this situation?

from vite-plugin-unocss-to-uni.

LLinVIP avatar LLinVIP commented on May 30, 2024

I‘ve used colorUI in current program, may be there is a confilict with it🤣. After adjusting some code, there is a new problem:
image
🫣

from vite-plugin-unocss-to-uni.

LLinVIP avatar LLinVIP commented on May 30, 2024

Perhaps I should learn unocss carefully🤣

from vite-plugin-unocss-to-uni.

zguolee avatar zguolee commented on May 30, 2024

Because the plugin replaces class with regular expressions, the class and :class attributes need to be on a single line, for example:

  <div
    class="py-1.5 dark:bg-opacity-30"
    :class="true ? 'bg-gray-200' : ''"
  >

Now I don't have a better solution.

from vite-plugin-unocss-to-uni.

LLinVIP avatar LLinVIP commented on May 30, 2024

Because the plugin replaces class with regular expressions, the class and :class attributes need to be on a single line, for example:

  <div
    class="py-1.5 dark:bg-opacity-30"
    :class="true ? 'bg-gray-200' : ''"
  >

Now I don't have a better solution.

Thanks, briliant developer. Sorry for inconviencing you, there is a new question that if I use colorui and unocss at same time, some styles of colorui will be covered by the unocss. Is there any method to prevent this situation?

from vite-plugin-unocss-to-uni.

zguolee avatar zguolee commented on May 30, 2024

unocss.config.ts provides a preprocess method, which may filter some ColorUI styles.

preprocess: (t) => {
  const classMargin = /^m-\d+\.?\d*$/
  if (!classMargin.test(t)) return t
},

The above code just doesn't handle things like m-1.5.

from vite-plugin-unocss-to-uni.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.