Skip to content

Latest commit

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

ToDesktop Tailwind Variants Plugin

This Tailwind CSS plugin provides custom variants to apply styles to apps that are running on the ToDesktop platform. There are also platform specific variants that target Windows, macOS, and Linux.

Features

  • Provides .todesktop variant to target apps running on the ToDesktop platform.
  • Provides .windows, .mac, and .linux variants.

Installation

Install the plugin from npm:

npm install @todesktop/tailwind-variants

Usage

Add the plugin to your tailwind.config.js file:

module.exports={// ...plugins: [require("@todesktop/tailwind-variants"),// ...],};

Once the plugin is installed and enabled, you can use the variants in your Tailwind CSS classes like so:

<!-- Hide div on desktop app --><divclass="todesktop:hidden"><!-- ... --></div>
<!-- Show div on desktop app, hide on web app --><divclass="hidden todesktop:block"><!-- ... --></div>
<!-- Hide div on Windows desktop app (will still show on Mac/Linux) --><divclass="windows:hidden"><!-- ... --></div>
<!-- On Mac desktop app make `div` rounded with a shadow --><divclass="w-20 h-20 bg-blue mac:rounded-lg mac:shadow-lg"><!-- ... --></div>

Acknowledgements

About

This Tailwind CSS plugin provides custom variants to apply styles to apps that are running on the ToDesktop platform

Resources

Stars

18 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages