Giter VIP home page Giter VIP logo

unocss-preset-mini-variants's Introduction

unocss-preset-mini-variants

Variants from @unocss/preset-mini. This preset uses preset-mini and re-exports its vatiants and options. You might find that some options don't do anything anymore. This preset comes with no utilities and is meant to be used in combination with other presets.

I hope this preset can simplify the development of other UnoCSS presets (e.g Windblade) by removing the need to reimplement the same variants every time.

This preset inherits variatns and options from

Installation

npm i -D unocss-preset-mini-variants
import presetVariants from 'unocss-preset-mini-variants'

UnoCSS({
  presets: [
    presetVariants(),
  ],
})

Differences with @unocss/preset-mini

No preconfigured breakpoints

This preset does not have a default theme so no breakpopints are preconfigured. If you want to use breakpoints configure your theme like the following:

theme: {
  // ...
  breakpoints: {
    'sm': '640px',
    'md': '768px',
    'lg': '1024px',
    'xl': '1280px',
    '2xl': '1536px',
  }
}

Or instead of breakpoints, try using intrinsic sizing (min-inline-size, max-width, minmax, auto-fill etc.).

Experimental Features

This preset includes experimental feature that may be changed in breaking ways at any time.

Media Hover

Media hover addresses the sticky hover problem where tapping target that includes hover style on mobile will persist that hover style until tapping elsewhere.

Since the regular :hover style most probably used so widely, the variant uses @hover syntax to distinguish it from the regular hover pseudo.

Example: @hover-text-red

Output:

@media (hover: hover) and (pointer: fine) {
  .\@hover-text-red:hover {
    --un-text-opacity: 1;
    color: rgba(248, 113, 113, var(--un-text-opacity));
  }
}

License

MIT License

unocss-preset-mini-variants's People

Contributors

eshimischi avatar starlederer avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

eshimischi

unocss-preset-mini-variants's Issues

Automate updates

This preset is very simple and does not implement anything unique so we can probably track preset-mini automatically.

Looking for help since I am not good at automation.

Tasklist:

  • UnoCSS releases are detected.
  • Dependencies are bumped and match latest UnoCSS.
  • Version is changed to match UnoCSS.
  • A test is executed to confirm preset can be used without errors (should probably ask UnoCSS team how to do this best).
  • New version is published to NPM automatically.

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.