Skip to content

[BUG] bg-center mark as conflicting with bg-[image:xxx] #260

@moshest

Description

@moshest

Describe the bug
I want to setup both background image and positioning but I get error of tailwindcss/no-contradicting-classname.

I need to use CSS vartiables as I want the URL to be dynamic (see here).

To Reproduce

Use the following code:

<section
    style={{ '--bg-small': `url(foo.jpg)` } as CSSProperties}
    className={`bg-[image:var(--bg-small)] bg-center`}
  />

Expected behavior
Code should work without an error.

Additional context
bg-[url(...)] with bg-center works fine though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions