我已经有了tailjs和daisyui的NextJS应用程序。我试图实施柏树

发布于 2025-02-11 02:07:57 字数 820 浏览 0 评论 0原文

我已经有了tailjs和daisyui的NextJS应用程序。我试图实现柏树,但不能配置它,并且仅出现de html。

// package.json

 "scripts": {
    
    "tailwind-generate": " npx tailwindcss --input styles/globals.css --output styles/tailwind-generated.css"
    }

// cypress/测试/button.cy.js

import { mount } from 'cypress/react'
import Button from '../../components/Inputs/Button'

describe('<Button >', () => {
  it('mount', () => {
    mount(<Button label={'Hola'} />, { stylesheet: '@/styles/tailwind-generated.css' })
  })
})

,但什么都没有发生

”在此处输入图像描述”

I already have the Nextjs app with tailwind and daisyUI. I Trying to implement Cypress but can not configure it and it only appears de html.

// package.json

 "scripts": {
    
    "tailwind-generate": " npx tailwindcss --input styles/globals.css --output styles/tailwind-generated.css"
    }

// cypress/tests/Button.cy.js

import { mount } from 'cypress/react'
import Button from '../../components/Inputs/Button'

describe('<Button >', () => {
  it('mount', () => {
    mount(<Button label={'Hola'} />, { stylesheet: '@/styles/tailwind-generated.css' })
  })
})

but nothing happens

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

飘然心甜 2025-02-18 02:07:57

对于简单的预生成样式表,您应该可以通过导入它来使用它。

import { mount } from 'cypress/react'
import Button from '../../components/Inputs/Button'
import from '../../styles/tailwind-generated.css'  // path may need adjusting

describe('<Button >', () => {
  it('mount', () => {
    mount(<Button label={'Hola'} />)
  })
})

用于基于CDN的样式

describe('<Button >', () => {
  it('mount', () => {
    mount(<Button label={'Hola'} />, {
      stylesheets: [
        'https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.2/css/bulma.css',
      ],)
  })
})

For a simple pre-generated style sheet, you should be able to use it by just importing it.

import { mount } from 'cypress/react'
import Button from '../../components/Inputs/Button'
import from '../../styles/tailwind-generated.css'  // path may need adjusting

describe('<Button >', () => {
  it('mount', () => {
    mount(<Button label={'Hola'} />)
  })
})

For CDN based styles

describe('<Button >', () => {
  it('mount', () => {
    mount(<Button label={'Hola'} />, {
      stylesheets: [
        'https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.2/css/bulma.css',
      ],)
  })
})
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文