Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

unocss-preset-fluid

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unocss-preset-fluid

A fluid preset for unocss

  • 0.0.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Unocss Preset Fluid

Elegantly scale type and space without breakpoints.
A fluid fonts and spaces utilites for unocss inspired by Utopia.

Installation

npm i unocss-preset-fluid unocss --save-dev # with npm
yarn add unocss-preset-fluid unocss -D # with yarn
pnpm add unocss-preset-fluid unocss -D # with pnpm

Usage

import { defineConfig } from 'unocss'
import { presetFluid } from 'unocss-preset-fluid'

export default defineConfig({
  presets: [
    presetFluid({
      // options
    }),
  ],
})

Examples and Documentation

Homepage
Examples

Options

Example:

{
    maxWidth: 1440,
    minWidth: 375,
    extendMaxWidth: null,
    extendMinWidth: null,
    remBase: 16,
    useRemByDefault: false,
}
MaxWidth 1440

This is the width in pixel where the fluid will stop growing.

MinWidth 375

This is the width in pixel where the fluid will stop shrinking.

ExtendMaxWidth null

This is the width in pixel where the fluid will stop growing but keeping the proportions set by maxWidth and minWidth.
This is useful if you want the fluid to grow further than the maxWidth but keeping the same size at maxWidth.

ExtendMinWidth null

This is the width in pixel where the fluid will stop shrinking but keeping the proportions set by maxWidth and minWidth.
This is useful if you want the fluid to shrink further than the minWidth but keeping the same size at minWidth.

RemBase 16

This is the base value for the rem unit.

UseRemByDefault false

If you are working with rem units, you can set this to true. This will make the fluid use rem by default.
For example

<div class="f-w-16-32">...</div> <!-- Default from 16px to 32px -->
<div class="f-w-1-2">...</div> <!-- RemByDefault from 1rem to 2rem -->

Utilities

PrefixExampleDefinition
f-textf-text-32-64font size
f-mf-m-32-64margin
f-mtf-mt-32-64margin top
f-mrf-mr-32-64margin right
f-mbf-mb-32-64margin bottom
f-mlf-ml-32-64margin left
f-mxf-mx-32-64margin left and margin right
f-myf-my-32-64margin top and margin bottom
f-pf-p-32-64padding
f-ptf-pt-32-64padding top
f-prf-pr-32-64padding right
f-pbf-pb-32-64padding bottom
f-plf-pl-32-64padding left
f-pxf-px-32-64padding left and padding right
f-pyf-py-32-64padding top and padding bottom
f-wf-w-32-64width
f-min-wf-min-w-32-64min-width
f-max-wf-max-w-32-64max-width
f-hf-h-32-64height
f-min-hf-min-h-32-64min-height
f-max-hf-max-h-32-64max-height
f-gapf-gap-32-64gap
f-gap-xf-gap-x-32-64gap left and gap right
f-gap-yf-gap-y-32-64gap top and gap bottom
f-intentf-intent-32-64text intent
f-leadingf-leading-32-64line height
f-scroll-mf-scroll-m-32-64scroll margin
f-scroll-mtf-scroll-mt-32-64scroll margin top
f-scroll-mrf-scroll-mr-32-64scroll margin right
f-scroll-mbf-scroll-mb-32-64scroll margin bottom
f-scroll-mlf-scroll-ml-32-64scroll margin left
f-scroll-mxf-scroll-mx-32-64scroll margin left and scroll margin right
f-scroll-myf-scroll-my-32-64scroll margin top and scroll margin bottom
f-scroll-pf-scroll-p-32-64scroll padding
f-scroll-ptf-scroll-pt-32-64scroll padding top
f-scroll-prf-scroll-pr-32-64scroll padding right
f-scroll-pbf-scroll-pb-32-64scroll padding bottom
f-scroll-plf-scroll-pl-32-64scroll padding left
f-scroll-pxf-scroll-px-32-64scroll padding left and scroll padding right
f-scroll-pyf-scroll-py-32-64scroll padding top and scroll padding bottom

Keywords

FAQs

Package last updated on 13 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc