Security News
Combatting Alert Fatigue by Prioritizing Malicious Intent
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
fela-plugin-rtl
Advanced tools
Uses rtl-css-js to convert a style object to its right-to-left counterpart.
yarn add fela-plugin-rtl
You may alternatively use npm i --save fela-plugin-rtl
.
Make sure to read the documentation on how to use plugins.
import { createRenderer } from 'fela'
import rtl from 'fela-plugin-rtl'
const renderer = createRenderer({
plugins: [rtl()],
})
Parameter | Value | Default | Description |
---|---|---|---|
defaultDirection | ("rtl" | "ltr") | rtl | The default direction which can be useful if one is using the theme.direction option to dynamically toggle rtl transformation |
{
paddingLeft: 20,
marginRight: '25px',
cursor: 'w-resize',
textShadow: 'red 2px 0'
}
{
paddingRight: 20,
marginleft: '25px',
cursor: 'e-resize',
textShadow: 'red -2px 0'
}
Apart from enforcing rtl all the time, one can also leverage a special props.theme.direction
property to enable/disable rtl transformation. This is especially useful together with React to disable transformation for subtrees.
const rule = () => ({
paddingLeft: 20,
marginRight: '25px',
cursor: 'w-resize',
textShadow: 'red 2px 0',
})
// will be transformed
renderer.renderRule(rule)
// wont be transformed
renderer.renderRule(rule, { theme: { direction: 'ltr' } })
Fela is licensed under the MIT License.
Documentation is licensed under Creative Commons License.
Created with ♥ by @robinweser and all the great contributors.
FAQs
Fela plugin to convert styles to RTL
The npm package fela-plugin-rtl receives a total of 0 weekly downloads. As such, fela-plugin-rtl popularity was classified as not popular.
We found that fela-plugin-rtl demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
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.
Security News
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.