Skip to content
This repository was archived by the owner on Jun 22, 2024. It is now read-only.
This repository was archived by the owner on Jun 22, 2024. It is now read-only.

Do not use dynamic class names #55

Description

@Thibaultfq

Hi,

I noticed that you used dynamic class names in your components. This is problematic because dynamic class names are not recognised by tailwind, and hence, not generated into the output css.

All the hover variables in colors.js are an example of that, but there are more such as focus:{{...}} or sm:{{...}}

Only solution is to have colors.js (and others ofc) reference only the full class names and remove modifiers such as hover:{{...}} or sm:{{...}} etc from source template files.
eg: colors.js

   navDefault: {
    barBg: 'sm:bg-white',
    textHover: 'sm:hover:text-red-900',
    mobileBg: 'bg-white',
    mobileBgActive: 'bg-red-500',
    mobileBgHover: 'hover:bg-red-100',
  }

see the tailwind documentation on this https://tailwindcss.com/docs/content-configuration#dynamic-class-names

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions