All Projects → yugasun → px2rem.scss

yugasun / px2rem.scss

Licence: MIT license
Self adaption plugin for mobile development.

Programming Languages

CSS
56736 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to px2rem.scss

Taptaptap
🕹 Open Source Javascript Game
Stars: ✭ 131 (+627.78%)
Mutual labels:  mobile-web
Moerail
铁路车站代码查询 × 动车组交路查询
Stars: ✭ 186 (+933.33%)
Mutual labels:  mobile-web
mobile-scroll-events
📜 移动端滚动事件大起底!
Stars: ✭ 51 (+183.33%)
Mutual labels:  mobile-web
Web.dev
The frontend, backend, and content source code for web.dev
Stars: ✭ 2,370 (+13066.67%)
Mutual labels:  mobile-web
Cmui
Lightweight UI solution for mobile web.
Stars: ✭ 182 (+911.11%)
Mutual labels:  mobile-web
Better Scroll
📜 inspired by iscroll, and it supports more features and has a better scroll perfermance
Stars: ✭ 15,199 (+84338.89%)
Mutual labels:  mobile-web
Vue Slim Better Scroll
💇‍♀️ 简洁易用的/渐进式的 vue 移动端滚动组件,仿QQ的下拉刷新和上拉滚动无限加载体验
Stars: ✭ 124 (+588.89%)
Mutual labels:  mobile-web
touchclick
Provides immediate visual feedback on touch for native-feeling web apps
Stars: ✭ 42 (+133.33%)
Mutual labels:  mobile-web
Swip
a library to create multi device experiments
Stars: ✭ 2,109 (+11616.67%)
Mutual labels:  mobile-web
Shigureader
用Chrome或者iPad轻松阅读整理漫画,播放音乐,以及观看视频. All-in-one solution for local doujin/anime/music file.
Stars: ✭ 254 (+1311.11%)
Mutual labels:  mobile-web
Mobile Select Area
手机联动选择地区
Stars: ✭ 157 (+772.22%)
Mutual labels:  mobile-web
Mobile First Animation
Gesture-driven animation on the mobile web (React Conf 2019)
Stars: ✭ 1,998 (+11000%)
Mutual labels:  mobile-web
Keen Slider
The HTML touch slider carousel with the most native feeling
Stars: ✭ 3,097 (+17105.56%)
Mutual labels:  mobile-web
Fundcharts
轻量级canvas数据可视化组件库(可在web移动端、微信小程序、服务端nodejs运行)。包含折线图/面积图、饼图/环形图、柱状图、雷达图(蜘蛛图),散点图,K线图,组合图,持续更新及维护。
Stars: ✭ 143 (+694.44%)
Mutual labels:  mobile-web
ngx-vant
Lightweight Mobile UI Components built on Vant and Angular
Stars: ✭ 34 (+88.89%)
Mutual labels:  mobile-web
Components
MobileUI was created thinking of making your hybrid application faster and smaller since you only install what you are really going to use for UI.
Stars: ✭ 125 (+594.44%)
Mutual labels:  mobile-web
Octoprint Touchui
A touch friendly interface for a small TFT module or phone
Stars: ✭ 226 (+1155.56%)
Mutual labels:  mobile-web
px2rem
convert px to rem in webpack
Stars: ✭ 21 (+16.67%)
Mutual labels:  px2rem
pxtorem-webpack-plugin
A webpack plugin for generating rem for stylesheet and inject auto calculate scripts.
Stars: ✭ 24 (+33.33%)
Mutual labels:  px2rem
Uber Mobile Web
This is an attempt to mock the new uber app into mobile web to learn how react can be used to optimize for mobile web.
Stars: ✭ 235 (+1205.56%)
Mutual labels:  mobile-web

px2rem.scss

Downloads Version

Self adaption plugin for mobile development.

Install

npm install px2rem.scss --save

Usage

  1. In html <head> tag, add viewport and designBaseWidth,as below:
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <title>demo</title>
  <script>
    var designBaseWidth = 375
  </script>
</head>
  1. import px2rem.config.min.js file,
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <title>demo</title>
  <script>
    var designBaseWidth = 375
  </script>
  <script src="https://unpkg.com/px2rem.scss"></script>
</head>

Notice: this plugin need calculate the html tag base font-size before dom rendering, otherwise web page will initial depend on font-size:16px to calculate rem value, this will cause page to rerender and repain.

  1. Before you use mixins in px2rem.scss, plz import firstly:
@import 'path/to/px2rem.scss';

html {
  @include font-dpr(16px);
  @include px2rem(width, 320px);
}

Remarks

px2rem.scss provide two sass mixin

font-dpr - calculate font size
px2rem - convert px to rem

Notice:The default base font size is 16px for html.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].