https://cypress.io logo
Join Discord
Powered by
# vue
  • r

    red-refrigerator-13075

    04/14/2021, 8:53 PM
    Normally I don't do any global css file because I tried to always use the style section of a SFC. so how can I use cypress ct with components that has their own styles?
  • s

    stocky-dream-36427

    04/14/2021, 8:53 PM
    If App.vue was using scoped styles there would be no problem
  • b

    bulky-sundown-74498

    04/14/2021, 8:53 PM
    @User I would advise to use a css file for app
  • b

    bulky-sundown-74498

    04/14/2021, 8:54 PM
    extract the css in this file and apply them to both #app and the tested object
  • b

    bulky-sundown-74498

    04/14/2021, 8:56 PM
    I might even go further and apply those styles directly to the body
  • b

    bulky-sundown-74498

    04/14/2021, 8:56 PM
    since this was the intention in the first place
  • r

    red-refrigerator-13075

    04/14/2021, 9:01 PM
    I'm testing it with scoped style in App.vue as you said but it doesn't seem to work either, also, I notice HelloWorld.vue is using scoped styles and they didn't seems to work either 🙁
  • r

    red-refrigerator-13075

    04/14/2021, 9:04 PM
    You're right, that should be the norm, I'll try to do it with any global css from now on, but, it seems that even with scoped styles it doesn't seem to work.
  • b

    bulky-sundown-74498

    04/14/2021, 9:05 PM
    https://github.com/xanxuz/vue-cypress-ct/pull/1/files
  • r

    red-refrigerator-13075

    04/14/2021, 9:07 PM
    Great, thanks for the PR @User 👍 , I'm trying to use that repo as a testing field for cypress ct with Vue and any help is welcome
  • r

    red-refrigerator-13075

    04/14/2021, 9:09 PM
    The last mistery is why the HelloWorld.vue compoent is not loading the scoped styles jejeje
  • t

    thankful-battery-80804

    04/14/2021, 9:12 PM
    Does anyone have an idea how to make this work with Tailwind. When I generate the CSS from my project from Tailwind (without purging it) I have a 5.5 MB CSS file, and Cypress has a hard time with that. The start of the unit test then takes a very long time. In Storybook and in the project the JIT compiler is running.
  • s

    stocky-dream-36427

    04/14/2021, 9:18 PM
    @User that's interesting. What's the JIT compiler?
  • s

    stocky-dream-36427

    04/14/2021, 9:18 PM
    like in particular, what webpack plugin is being used?
  • s

    stocky-dream-36427

    04/14/2021, 9:18 PM
    We should just be using the same config as your local devserver... nothing else
  • s

    stocky-dream-36427

    04/14/2021, 9:19 PM
    @User ^^ this works for me out of the box
  • s

    stocky-dream-36427

    04/14/2021, 9:19 PM
    no code changes
  • s

    stocky-dream-36427

    04/14/2021, 9:19 PM
    Using Bart's PR
  • t

    thankful-battery-80804

    04/14/2021, 9:20 PM
    JIT checks at runtime which tailwind classes are needed and generates a CSS file with them. This is smaller and can grow further when new classes are noted.
  • t

    thankful-battery-80804

    04/14/2021, 9:20 PM
    https://blog.tailwindcss.com/just-in-time-the-next-generation-of-tailwind-css
  • s

    stocky-dream-36427

    04/14/2021, 9:20 PM
    Tyvm. Looking.
  • s

    stocky-dream-36427

    04/14/2021, 9:20 PM
    We work with any webpack setup so like... it's just a matter of making sure the right loaders etc are run
  • r

    red-refrigerator-13075

    04/14/2021, 9:20 PM
    😮
  • s

    stocky-dream-36427

    04/14/2021, 9:21 PM
    I see I see. Spiking into it now.
  • s

    stocky-dream-36427

    04/14/2021, 9:21 PM
    Do you have a nice playground project for me?
  • s

    stocky-dream-36427

    04/14/2021, 9:22 PM
    https://github.com/cypress-io/cypress/issues/15992 @User
  • t

    thankful-battery-80804

    04/14/2021, 9:23 PM
    ah nice 🙂
  • s

    stocky-dream-36427

    04/14/2021, 9:24 PM
    If you have a playground to add, can you put it there?
  • s

    stocky-dream-36427

    04/14/2021, 9:25 PM
    If you're playing around with Vite btw, my Vite x Cypress demo has WindiCSS which is on-demand tailwind for esm
  • t

    thankful-battery-80804

    04/14/2021, 9:25 PM
    i build a playground
1...151617...37Latest