Socket
Socket
Sign inDemoInstall

styled-components-rtl

Package Overview
Dependencies
2
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    styled-components-rtl

Allows u add ltr-rtl direction switching for your styled components


Version published
Maintainers
1
Install size
6.70 MB
Created

Readme

Source

styled-components-rtl

Allows u add ltr-rtl direction switching for your styled components

Using

import {ThemeProvider} from "styled-components"
import rtl from "styled-components-rtl";

const List = styled.div``;
const ListItem = styled.div`
    ${rtl`
        margin-left: 1rem;
    `}
`;

const theme = {
  dir: "rtl"
  // OR direction: "rtl"
};

render(
  <ThemeProvider theme={theme}>
    <List>
      <ListItem>Item 1</ListItem>
      <ListItem>Item 2</ListItem>
    </List>
  </ThemeProvider>
);

If theme.dir equal rtl instead of margin-left will be margin-right;

Contributors

Thanks goes to these wonderful people:


Max Kudla

Anees Hikmat Abu-hamid

Omar Houmz

Keywords

FAQs

Last updated on 12 Feb 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