Usage Guide

Your guide on how to use and make the most out of RTLCSS

Time is Priceless, Caffeine is Not! Buy Me a Coffee ☕

Aliases

Aliases allows you to define how to process Custom properties (sometimes referred to as CSS variables or cascading variables).

§Example

Let’s say we want to treat --small-padding as a padding property:

  • LTR CSS

    /*rtl:options:
    {
        "aliases": {
            "--small-padding": "padding"
        }
    }*/
    :root {
      --small-padding: 2px 5px 2px 10px;
    }
    
    .rule {
      padding: var(--small-padding);
    }
  • RTL CSS

    :root {
      --small-padding: 2px 10px 2px 5px;
    }
    
    .rule {
      padding: var(--small-padding);
    }

PREVNEXT