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
Maintainers
1
Install size
6.11 MB
Created

Readme

Source

Sass Direction

Version Downloads Dependencies Status License

Introduction

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

Installation

npm install @sass-collective/direction

Usage

@use "@sass-collective/direction";

.foo {
    margin-left: 20px;
    margin-right: 0;

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

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

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

Result

.foo {
    margin-left: 20px;
    margin-right: 0;
}

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

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

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

NOTE: you can use the legacy @import with dedicated prefix, ex. sass-direction-styles().

API

Mixins

MixinDescription
styles($direction, $root-selector)Create direction rule.

Keywords

FAQs

Last updated on 01 Jul 2021

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