Skip to content

Instantly share code, notes, and snippets.

@jottenlips
Created October 13, 2020 13:47
Show Gist options
  • Save jottenlips/379880560ccd4c111887fda1cb666769 to your computer and use it in GitHub Desktop.
Save jottenlips/379880560ccd4c111887fda1cb666769 to your computer and use it in GitHub Desktop.
Replace all occurrences of px with ints for react projects to be fully compatible with react native

Find

'(\d.)px'

Replace

$1

'10px' is replaced with 10

Note: styled-components needs px so do not find-replace any units ending in ;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment