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.1.1
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
17
decreased by-45.16%
Maintainers
1
Weekly downloads
 
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

styles($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.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: div) {
        margin-left: 0;
        margin-right: 20px;
    }
}

Legacy @import

@import "@sass-collective/direction";

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

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

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

    // Root Selector
    @include sass-direction-styles($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 29 Mar 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