Skip to content

Migrate postcss-px-to-rem with twind #110

Answered by sastan
sondh0127 asked this question in Q&A
Discussion options

You must be logged in to vote

I think that maybe possible using the prefix option:

import { setup, autoprefix as prefix } from 'twind'
// Or if you do not want to prefix properties
// import { setup, noprefix as prefix } from 'twind'

const pxToRem = (value) => {
  // Your implementation here
  return value
}

setup({
  // prefix: (property: string, value: string, important?: boolean) => string
  prefix: (property, value, important) => prefix(property, pxToRem(value), important),
})

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@sondh0127
Comment options

@sastan
Comment options

Answer selected by sastan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants