Skip to content

hello-astar/vue-inline-px-to-rem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vue-inline-px-to-rem

a webpack loader for vue projects to transform px units exiting in inline styles to rem units

Getting Started

Using npm to install vue-inline-px-to-rem

npm install --save-dev vue-inline-px-to-rem

Add the loader to your webpack config. For example:

vue.config.js

module.exports = {
  chainWebpack (config) {
    ...
    config.module
      .rule('vue')
      .test(/\.vue$/)
      .use('vue-inline-px-to-rem')
      .loader('vue-inline-px-to-rem')
      .options({
        rootValue: 100
      })
      .end()
      ...
  }
}

Options

Name Type Default Description
rootValue Number 100 Represents the root element font size or returns the root element font size based on the input parameter

More

to-do-list

  • add unit testing
  • add ignore-line or ignore-page feature

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published