npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

rem-flexible

v3.2.4

Published

Build flexible page on mobile platform

Downloads

34

Readme

rem-flexible

npm version npm downloads license

This is a fork of amfe-flexible

This package is published with some minor changes. The main function flexible can be passed two optional arguments. The first is design width, The second is pixel per rem.

Classic edition (0.3.2)

由于viewport单位得到众多浏览器的兼容,lib-flexible这个过渡方案已经可以放弃使用,不管是现在的版本还是以前的版本,都存有一定的问题。建议大家开始使用viewport来替代此方案。vw的兼容方案可以参阅《如何在Vue项目中使用vw实现移动端适配》一文。

Usage

Using unpkg

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<script src="//unpkg.com/rem-flexible"></script>
<script>
  // 设计稿宽度为750px,每1rem等于100px
  flexible(750, 100)
</script>

Using npm package

npm i rem-flexible

import in HTML file

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<script src="./node_modules/rem-flexible/dist/flexible.umd.min.js"></script>
<script>
  // 设计稿宽度为750px,每1rem等于100px
  flexible(750, 100)
</script>

or import esm module

import flexible from 'rem-flexible'
flexible(750, 100)

Related projects

Browser Compatibility

Browser Compatibility

Changelog

See CHANGELOG.md