Vueless Docs
ComponentsGitHubWebsite
  • Installation
    • Quick start (Vue)
    • Quick start (Nuxt)
    • Class autocompletion
    • Minimal requirements
    • Storybook docs
  • Global customization
    • General
    • Colors
    • Rounding
    • Focus Outline
    • Dark mode
    • Base Classes
    • Custom tailwind classes
  • Component customization
    • General
    • Styling
    • Conditional styling
    • Extends styling from keys
    • Nested components styling
    • Classes smart merging
    • Props defaults
    • Redefining props
    • Defining custom props
    • Internationalization (i18n)
  • Creating own components
    • Vueless file structure
    • Create new component
    • Copy existing component
  • Svg Icons
    • General usage
    • Custom icons
    • Dynamic import
    • Advanced settings
  • Helpers
    • Change settings in runtime
Powered by GitBook
On this page
  • Custom tailwind class
  • CSS variables
  1. Global customization

Rounding

Last updated 3 months ago

You can set three sizes of border radiuses globally for all Vueless components.

vueless.config.{js,ts}
export default {
  roundingSm: 4,
  rounding: 6, /* default -> 8 (pixels) */
  roundingLg: 8,
}

You can set any border-radius value in pixels, but we highly recommend adhering to values for consistency.

If you define only the rounding value, roundingSm and roundingLg will be automatically calculated. The expected values are listed in the table below:

roundingSm
rounding
roundingLg

0

0

2

0

2

8

2

4

10

4

6

12

4

8

14

6

10

16

8

12

18

10

14

20

12

16

22

In the config, values are specified in pixels for simplicity, but they are automatically converted into rem under the hood.

Custom tailwind class

To implement global border radius stylings, Vueless provides custom Tailwind CSS classes: rounded-dynamic-sm, rounded-dynamic, rounded-dynamic-lg. Feel free to use these classes in your components whenever you need consistent rounding across your project.

CSS variables

You can also use the corresponding CSS variables directly:

  • --vl-rounding,

  • --vl-rounding-sm,

  • --vl-rounding-lg.

Tailwind CSS’s predefined border-radius