Coder Social home page Coder Social logo

tailwindcss-bg-patterns's People

Contributors

mystic-mango avatar thillmann avatar xhomu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

tailwindcss-bg-patterns's Issues

Custom colors don't set the "--pattern-color-77" or "--pattern-color-55" variables

In the default example for setting a pattern color, this code is used:

<div className="pattern-blue-500"/>

And we can see that the tailwind "macro" essentially sets these 3 variables which are used by the pattern system:

image

But it doesn't work the same when I provide a custom color that I defined in the theme in tailwind.config.js. I have the following code in a React node:

<div className="pattern-isometric pattern-opacity-100 pattern-rpPatternBlue500 pattern-bg-transparent">
  <MaxWidthSection constrainContent="max-w-4xl">
    {renderGamesSection(layoutDataWrapper, gameData)}
  </MaxWidthSection>
</div>

Which as you can see does not set the -77 color or -55 color the same as if I used a preset color:

image

Which ultimately breaks some of the patterns completely (it doesn't show up) because the needed variables are not defined:

image

Namely the isometric and 3D/gradient patterns which require this. The dots and simple shape patterns don't break since it seems like they don't need -77 and -55 to function.

There is a workaround which is to set the variables manually via style like this:

<div 
  style={{"--pattern-color-77" : "#363f5810", "--pattern-color-55" : "#363f5805"} as React.CSSProperties}
  className="pattern-isometric pattern-opacity-100 pattern-rpPatternBlue500 pattern-bg-transparent">
  <MaxWidthSection constrainContent="max-w-4xl">
    {renderGamesSection(layoutDataWrapper, gameData)}
  </MaxWidthSection>
</div>

But this isn't ideal I would think... I guess this comes up because somewhere in the code it assumes that the provided color is a preset or at least uses 100% opacity? But if you provide a color with non-100% opacity like I did here I feel like it should calculate 77% and 55% of the opacity of that to be used in these variables, or expose some tailwind shortcut to directly set them without having to go through style. Let me know what's possible here, thanks!

How to reset opacity?

I am using pattern-opacity-10 in a container tag, and all inherited tags also have opacity-10. How
can I fix that?

What I want is that the opacity only apply to the pattern

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.