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
40
increased by48.15%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Sass Direction

Version Downloads Dependencies Status License

Introduction

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

Install

npm install @sass-collective/direction --save

API

Mixins

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

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;
    }
}

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

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;
}

Keywords

FAQs

Last updated on 11 Apr 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