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
92
increased by95.74%
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.

Installation

npm install @sass-collective/direction

Usage

@use "@sass-collective/direction";

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

API

Mixins

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

Example

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

Keywords

FAQs

Last updated on 28 May 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