cssinjs/jss

Using arrow function on jss-rtl dependent property does not works well

Open

#1.234 aberto em 21 de nov. de 2019

Ver no GitHub
 (10 comments) (4 reactions) (0 assignees)JavaScript (434 forks)batch import
bughelp wanted

Métricas do repositório

Stars
 (7.000 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

Expected behavior:

The rtl plugin should switch the styles.

Describe the bug:

The rtl plugin doesn't switch all the styles.

const useStyles = createUseStyles({
  myButton1: {
    paddingLeft: "16px" ✅
  },
  myButton2: {
    paddingRight: ({ isMobile }) => (isMobile ? 0 : "26px") ❌
  },
  myLabel: props => ({
    paddingRight: "8px" ✅
  })
});

Codesandbox link:

https://codesandbox.io/s/react-jss-playground-37lqs

Versions (please complete the following information):

  • jss: 10.0.0
  • Browser [e.g. chrome, safari]: all
  • OS [e.g. Windows, macOS]: all

First reported in https://github.com/mui-org/material-ui/issues/18477.

Guia do colaborador