Giter Club home page Giter Club logo

Comments (3)

sinanbekar avatar sinanbekar commented on September 26, 2024 1

@caleb654
Ok, After reading https://tailwindcss.com/blog/tailwindcss-v3-2 release, you can use Tailwind CSS for content with Shadow DOM. This release adds official support for multiple configs in the same project so it won't add unnecessary CSS to the page. I will add better content example after @crxjs/vite-plugin v2.x stable release.

from browser-extension-react-typescript-starter.

sinanbekar avatar sinanbekar commented on September 26, 2024

Hi @caleb654, thank you for reaching out. This starter uses vite and @crxjs/vite-plugin under the hood for development. I can confirm that sometimes it fails to detect changes and process some files. I hope that it will be fixed in vite 3 and @crxjs/vite-plugin new release. You can track it here @crxjs/vite-plugin. As a silly workaround you can add ?inline like import styles from './Counter.module.css?inline', save then delete ?inline. Finally, do fully refresh the page and it will continue to work normally.

I wouldn't recommend using Tailwind CSS for injecting content into the page because of possible class, variable conflicts also it will inject other pages (popup, options etc... but unused in content) classes. You can try https://github.com/robbevp/postcss-multiple-tailwind but I didn't try it.

You can use @apply in the CSS module. You may be even needed Shadow DOM for encapsulation. https://alirezavalizade.medium.com/use-shadow-dom-for-encapsulation-css-in-google-extensions-19f0aef542c7

from browser-extension-react-typescript-starter.

leerobert avatar leerobert commented on September 26, 2024

@caleb654 Ok, After reading https://tailwindcss.com/blog/tailwindcss-v3-2 release, you can use Tailwind CSS for content with Shadow DOM. This release adds official support for multiple configs in the same project so it won't add unnecessary CSS to the page. I will add better content example after @crxjs/vite-plugin v2.x stable release.

Any chance you could put together this with @crxjs/vite-plugin@beta in a branch and perhaps merge when it is stable release? Tailwind CSS in content script would be a huge add.

from browser-extension-react-typescript-starter.

Related Issues (8)

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.