The source code for this blog is available on GitHub.

Blog.

The World of Errors

Cover Image for The World of Errors
Julia Stjerna
Julia Stjerna

The World of Errors

1.

I wanted to be able to create a 'main.css' file in my react native application to add custom variables like this:

@tailwind base;

@tailwind components;

@tailwind utilities;

.theme-dark {
  --color-custom-100: 158, 200, 185;
  --color-custom-200: 92, 131, 116;
  --color-custom-300: 27, 66, 66;
  --color-custom-400: 9, 38, 53;
}

.theme-light {
  --color-custom-100: 9, 38, 53;
  --color-custom-200: 27, 66, 66;
  --color-custom-300: 92, 131, 116;
  --color-custom-400: 158, 200, 185;
}

NativeWind v2 have no support for an external css file like tailwind has, but they're updating this in NativeWind v4 that will be released in early 2024.