react-native-tailwindcss icon indicating copy to clipboard operation
react-native-tailwindcss copied to clipboard

Add special case for hairlineWidth spacing

Open enagorny opened this issue 5 years ago • 3 comments

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

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

enagorny avatar Mar 31 '20 08:03 enagorny

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

TVke avatar Mar 31 '20 12:03 TVke

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.

thomaschaaf avatar May 26 '20 15:05 thomaschaaf

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

greetings Thomas

TVke avatar May 26 '20 15:05 TVke