TVke / react-native-tailwindcss

A react-native style system based on TailwindCSS
https://tvke.github.io/react-native-tailwindcss/
MIT License
565 stars 34 forks source link

Add special case for hairlineWidth spacing #26

Open enagorny opened 4 years ago

enagorny commented 4 years ago

Add ability to create hairline width spacing. It's especially useful for borders

See: https://reactnative.dev/docs/stylesheet#hairlinewidth

TVke commented 4 years ago

Hi @enagorny

As it is a value constant I think you can maybe add it in your custom config. I thing it could work (if it doesn't, it will be a simpel change). If you suggest this as a default config setting, how would you call it? 🤔

greetings Thomas

thomaschaaf commented 4 years ago

You can simply add it by specifying the tailwind.config.js as follows:

import {StyleSheet} from 'react-native';

module.exports = {
  theme: {
    extend: {
      borderWidth: {
        hairline: StyleSheet.hairlineWidth,
      },
    },
  },
  variants: {},
  plugins: [],
};

Maybe however the default tailwind config could be extended.

TVke commented 4 years ago

a good idea @thomaschaaf I will add it to the defaults 😃 and thank you for bringing it up @enagorny

greetings Thomas