Code Monkey home page Code Monkey logo

Comments (4)

kenotron avatar kenotron commented on May 22, 2024

I'm a fan of this repo, so I made a fork that has support for TW2.0 dark mode. The way it is put together isn't very friendly to someone who might want to use this in real life, maybe? The tailblocks.css in /public is the one you want to use, it's only 25k pre-gzipped.

I wrote a buuuunch of scripts that will merge the current light & dark .js files into one merged .js file. I also added support for theme through css variables. Take a look:

https://github.com/kenotron/tailblocks

If there's interest from @mertJF, I can make a PR, but the change is extensive:

  1. added acorn / acorn-walk & family to get dark-mode class names merging working
  2. replaced ${props.theme} with a CSS variable based one
  3. added a tailwind.css.js, postcss, cssnano + a yarn css script that will generate a custom css that includes dark mode + css vars
  4. run yarn css to regenerate the tailblocks.css

from tailblocks.

kenotron avatar kenotron commented on May 22, 2024

This is an example: https://github.com/kenotron/tailblocks/blob/3370b6b3f3ed248139bd94557e068c52f9c61c05/src/blocks/contact/merged/a.js#L39

You can see how I have dark: prefix, replacement of ${props.theme} into class names like dark:focus:ring-theme-900. I changed a bit of logic in App.js to make it so that the theme and dark mode switches mostly affect classes in the frame

from tailblocks.

kenotron avatar kenotron commented on May 22, 2024

Okay created #64 to illustrate what I mean via PR view for easy peeking. It's Draft because I made so many changed without discussing with @mertJF ahead of time

from tailblocks.

mertJF avatar mertJF commented on May 22, 2024

I've no plan to support a dark mode feature with adding a lot of classes. The tailblocks work with TailwindCSS defaults so if I add the feature some potential users couldn't use the blocks. On the other hand, I want to thank you for your effort.

from tailblocks.

Related Issues (20)

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.