All Projects → airen → vw-layout

airen / vw-layout

Licence: other
Mobile website layout with viewport units

Programming Languages

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

Projects that are alternatives of or similar to vw-layout

Postcss Grid Kiss
A PostCSS plugin to keep CSS grids stupidly simple
Stars: ✭ 1,270 (+2602.13%)
Mutual labels:  postcss, layout
Rem Vw Layout
移动端 REM布局 与 Viewport (VW) 布局的实例运用
Stars: ✭ 176 (+274.47%)
Mutual labels:  layout, viewport
Webpack-Starter-Kit
Webpack 4 stater kit with SCSS, PostCSS, Babel & ESLint
Stars: ✭ 41 (-12.77%)
Mutual labels:  postcss
eleventy solo starter njk
Further development suspended as of 2021-09-11. Please refer instead to https://www.11ty.dev/docs/starter/ for a wide selection of other Eleventy starter sets.
Stars: ✭ 22 (-53.19%)
Mutual labels:  postcss
sircus
Flexible Modular CSS Family for Designing in the Browser.
Stars: ✭ 19 (-59.57%)
Mutual labels:  postcss
FastBanner
🔥快速轮播图,支持自定义布局和使用自有图片显示组件
Stars: ✭ 27 (-42.55%)
Mutual labels:  layout
postcss-inline-base64
PostCSS plugin used to replace value inside of url function to base64
Stars: ✭ 23 (-51.06%)
Mutual labels:  postcss
css-layout
旨在肖除混乱的CSS布局教程
Stars: ✭ 18 (-61.7%)
Mutual labels:  layout
ci4-album
🔥 CodeIgniter 4 example Album module uses Domain Driven Design Architecture with Tactical Pattern
Stars: ✭ 67 (+42.55%)
Mutual labels:  layout
EZAnchor
An easier and faster way to code Autolayout
Stars: ✭ 25 (-46.81%)
Mutual labels:  layout
SJCenterFlowLayout
Carousel flow layout for UICollectionView on iOS.
Stars: ✭ 34 (-27.66%)
Mutual labels:  layout
quantum-blox
Quantum blox - modular UI boilerplate in react
Stars: ✭ 12 (-74.47%)
Mutual labels:  postcss
ErrorLayout
Simple layout to show custom error toast with animation
Stars: ✭ 13 (-72.34%)
Mutual labels:  layout
postcss-each
PostCSS plugin to iterate through values
Stars: ✭ 93 (+97.87%)
Mutual labels:  postcss
postcss-image-set-polyfill
PostCSS plugin for polyfilling image-set CSS function
Stars: ✭ 45 (-4.26%)
Mutual labels:  postcss
antd-color-replacer
适用于 webpack 环境下 的 主题切换插件
Stars: ✭ 22 (-53.19%)
Mutual labels:  postcss
postcss-relaxed-unit
🍮Postcss-relaxed-unit is a postcss plugin for unit tranformation and make write css easier with custom unit.
Stars: ✭ 44 (-6.38%)
Mutual labels:  postcss
soba
Kirby starter theme that uses Twig, PostCSS, and Browsersync
Stars: ✭ 16 (-65.96%)
Mutual labels:  postcss
svelte-intersection-observer
Detect if an element is in the viewport using the Intersection Observer API
Stars: ✭ 151 (+221.28%)
Mutual labels:  viewport
sapper-postcss-template
A template that includes Sapper for Svelte and PostCSS preprocessing with Tailwind CSS
Stars: ✭ 84 (+78.72%)
Mutual labels:  postcss

vw-layout

Travis Build Status Build status

Mobile website layout with viewport units.

vw-layout is an NPM package that helps you to create the mobile website layout with viewport units. It dependencies on postcss-aspect-ration-mini,postcss-px-to-viewport and postcss-viewport-units.

In addition, to be compatible with more mobile devices, the viewport unit is required to use polyfill from the viewport unit. We can use the Viewport Units Buggyfill.

Install

npm i vw-layout --save

Usage

Add the following code to the entry file. eg. Vue project, in the main.js file:

import 'vw-layout'

If your project uses a webpack, you can add the associated PostCSS plug-in configuration to the postcssrc.js file.

module.exports = {
    "plugins": {
        "postcss-aspect-ratio-mini": {}, 
        "postcss-px-to-viewport": {
            viewportWidth: 750,      // (Number) The width of the viewport.
            viewportHeight: 1334,    // (Number) The height of the viewport.
            unitPrecision: 3,        // (Number) The decimal numbers to allow the REM units to grow to.
            viewportUnit: 'vw',      // (String) Expected units.
            selectorBlackList: ['.ignore', '.hairlines'],  // (Array) The selectors to ignore and leave as px.
            minPixelValue: 1,       // (Number) Set the minimum pixel value to replace.
            mediaQuery: false       // (Boolean) Allow px to be converted in media queries.
        }, 
        "postcss-viewport-units":{},
    }
}

If your project is not using a webpack, go to the corresponding PostCSS plug-in website and view the configuration.

Thanks

Special thanks to @yisibl@evrone and @springuper for providing such an excellent PostCSS plug-in. Tanks to @rodneyrehm for providing viewport units polyfill.

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].