Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flex-grow/flex-shrink classes not working on v1 beta 10 #32

Open
apolzon opened this issue Jun 11, 2019 · 2 comments
Open

flex-grow/flex-shrink classes not working on v1 beta 10 #32

apolzon opened this issue Jun 11, 2019 · 2 comments
Labels
bug Something isn't working

Comments

@apolzon
Copy link

apolzon commented Jun 11, 2019

The flex-grow and flex-shrink classes are incorrectly looking for flex["grow"]/flex["shrink"] in the theme, which results in no styles being applied:

    Object(_emotion_css__WEBPACK_IMPORTED_MODULE_1__["default"])({
      "display": "flex",
      "flex": _tailwindConfig.theme.flex["grow"]

My guess is its because the flex className exists in the dynamicStyles definition, causing the macro to treat this case as a prefix. For example, flex-1 works fine with the default tailwind theme, because theme.flex["1"] is defined out of the box.

End users can workaround by extending the default theme to define theme.flex.grow and theme.flex.shrink:

  const defaultTheme = require('tailwindcss/defaultTheme')
  const config = {
     ...defaultTheme,
     theme: {
       flex: {
         ...defaultTheme.flex,
         grow: "1 0",
         shrink: "0 1",
       }
    }
  }

I don't think this is exactly the same as just defining flex-grow: 1, but its the closest thing to a workaround for now if you want to avoid writing your own style rule.

@bradlc
Copy link
Owner

bradlc commented Jun 12, 2019

Thanks @apolzon, I will get this sorted this week

@bradlc bradlc added the bug Something isn't working label Jun 12, 2019
@davidnknight
Copy link

Still not working for me with ^1.0.0-alpha.10. I assume this hasn't been fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants