Socket
Socket
Sign inDemoInstall

postcss-cssjanus

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    postcss-cssjanus

PostCSS plugin plugin to create RTL rules using CSSJanus


Version published
Weekly downloads
38
increased by52%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

PostCSS cssjanus

PostCSS plugin to create RTL rules using CSSJanus. (Only RTL styles are generated).

The code fork for postcss-janus,just modify little.

Install

npm
npm install cssjanus postcss-cssjanus -D

Basic usage

Using postcss-loader in Webpack
// postcss.config.js

const plugins = {
  'tailwindcss': {},
  'autoprefixer': {},
  'postcss-flexbugs-fixes': {},
  'postcss-preset-env': {
    autoprefixer: {
      flexbox: true,
      // grid: 'autoplace'
    },
    stage: 3,
    features: {
      'custom-properties': false,
    },
  },
}

if (process.env.rtl === '1') {
  plugins['postcss-cssjanus'] = {
    'transformDirInUrl': false,
    'transformEdgeInUrl': false
  }
}

module.exports = {
  plugins,
}

Options

OptionDefaultTypeDescription
transformDirInUrlfalsebooleanSwap ltr and rtl strings in URLs
transformEdgeInUrlfalsebooleanSwap left and right strings in URLs

Directives

Directives should be added as comments before a CSS rule block or a property, e.g:

/* @ruleDirective */
.example {
    /* @propertyDirective */
    color: white;
}
DirectiveDescription
@noflipAvoid flipping certain CSS property or an entire rule block
@transformDirInUrlSwap ltr and rtl strings in a certain property (it will ignore the global transformDirInUrl option
@transformEdgeInUrlSwap left and right strings in a certain property (it will ignore the global transformEdgeInUrl option

If you do not use PostCSS, add it according to official docs and set this plugin in settings.

Keywords

FAQs

Last updated on 17 Jun 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