Socket
Socket
Sign inDemoInstall

@sass-collective/direction

Package Overview
Dependencies
18
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @sass-collective/direction

Manage content direction for languages right-to-left or left-to-right rules.


Version published
Weekly downloads
28
increased by133.33%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Sass Direction

Version Downloads License

Introduction

Manage content direction for languages right-to-left or left-to-right rules.

Installing

npm install @sass-collective/direction

Usage

@use "@sass-collective/direction";

Tokens

KeyDescription
rtlSets CSS rules for right-to-left direction.
ltrSets CSS rules for left-to-right direction.

API

Sass mixins

MixinDescription
styles($direction, $root-selector)Sets direction rule with optional $root-selector option. Default $direction is rtl.
Add direction rule with direction.styles()

The following Sass...

@use "@sass-collective/direction";

.foo {
    @include direction.styles {
        margin-left: 0;
        margin-right: 20px;
    }

    @include direction.styles(ltr) {
        margin-left: 20px;
        margin-right: 0;
    }

    @include direction.styles($root-selector:. bar) {
        margin-left: 0;
        margin-right: 20px;
    }
}

...will produce the following CSS...

[dir="rtl"] .foo {
    margin-left: 0;
    margin-right: 20px;
}

[dir="ltr"] .foo {
    margin-left: 20px;
    margin-right: 0;
}

[dir="rtl"] .bar .foo {
    margin-left: 0;
    margin-right: 20px;
}

Keywords

FAQs

Last updated on 03 Jan 2022

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc