Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sass-collective/direction

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sass-collective/direction

Manage content direction for languages right-to-left.

  • 2.0.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Sass Direction

Version Downloads Dependencies Status License

Introduction

Manage content direction for languages right-to-left.

Install

npm install @sass-collective/direction --save

Usage

Mixin

direction($direction: right, $root-selector: null);
Options
NamesDefaultValues
$directionrightleft or right
$root-selectornullClass, ID or HTML element.

Module System

@use "@sass-collective/direction";

p {
    margin-left: 20px;
    margin-right: 0;

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

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

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

Legacy @import

@import "@sass-collective/direction";

p {
    margin-left: 20px;
    margin-right: 0;

    // RTL
    @include sass-direction {
        margin-left: 0;
        margin-right: 20px;
    }

    // LTR
    @include sass-direction(left) {
        margin-left: 0;
        margin-right: 20px;
    }

    // Root Selector
    @include sass-direction($root-selector: div) {
        margin-left: 0;
        margin-right: 20px;
    }
}

CSS

p {
    margin-left: 20px;
    margin-right: 0;
}

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

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

/** Root Selector **/
[dir="rtl"] div p {
    margin-left: 0;
    margin-right: 20px;
}

Keywords

FAQs

Package last updated on 11 Jan 2021

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc