2018-05-16 admin


什么是pure,Pure.css 是 Yahoo 出品的一组轻量级、响应式纯 CSS 模块,适用于任何 Web 项目。



A set of small, responsive CSS modules that you can use in every web project. http://purecss.io/

Build StatusDependency StatusGitter

Use From the CDN:

<link rel="stylesheet" href="https://unpkg.com/purecss@1.0.0/build/pure-min.css">

Note: You can customize which Pure modules you need.

Install with Bower:

$ bower install --save pure

Install with NPM:


Pure is meant to be a starting point for every website or web app. We take care of all the CSS work that every site needs, without making it look cookie-cutter:

  • A responsive grid that can be customized to your needs.

  • A solid base built on Normalize.css to fix cross-browser compatibility issues.

  • Consistently styled buttons that work with <a> and <button> elements.

  • Styles for vertical and horizontal menus, including support for dropdown menus.

  • Useful form alignments that look great on all screen sizes.

  • Various common table styles.

  • An extremely minimalist look that is super-easy to customize.

  • Responsive by default, with a non-responsive option.

  • Extremely small file size: 4.5KB minified + gzip.

Get Started

To get started using Pure, go to the Pure CSS website. The website has extensive documentation and examples to help you start using Pure.

You can include the Pure CSS file in your project by fetching it from Yahoo’s CDN:

<link rel="stylesheet" href="https://unpkg.com/purecss@1.0.0/build/pure-min.css">

You can also install Pure using Bower, using the following command:

$ bower install --save pure

Or you can install Pure using NPM:

Build From Source

Optionally, you can build Pure from its source on Github. To do this, you’ll need to have Node.js and npm installed. We use Grunt to build Pure.

$ git clone git@github.com:pure-css/pure.git
$ cd pure
$ npm install
$ grunt

Build Files

Now, all Pure CSS files should be built into the pure/build/ directory. All files that are in this build directory are also available on the CDN. The naming conventions of the files in the build/ directory follow these rules:

  • [module]-core.css: The minimal set of styles, usually structural, that provide the base on which the rest of the module’s styles build.

  • [module]-nr.css: Rollup of [module]-core.css + [module].css + [module]-[feature].css from the src/[module]/ dir. This is the non-responsive version of a module.

  • [module].css: Rollup of [module]-nr.css + [module]-r.css from the build/ dir. This is the responsive version of a module.

  • *-min.css: A minified file version of the files of the same name.

  • pure.css: A rollup of all [module].css files in the build/ dir. This is a responsive roll-up of everything, non-minified. Note: does not contain responsive grids with @media queries.

  • pure-min.css: Minified version of pure.css that should be used in production.

  • pure-nr.css: A Rollup of all modules without @media queries. This is a non-responsive roll-up of everything, non-minified.

  • pure-nr-min.css: Minified version of pure-nr.css that should be used in production.

  • grids-responsive.css: Unminified version of Pure’s grid stylesheet which includes @media queries.

  • grids-responsive-min.css: Minified version of grids-responsive.css that should be used in production.

Browser Support and Testing

Pure is tested and works in:

  • IE 8+
  • Latest Stable: Firefox, Chrome, Safari
  • iOS 6-8
  • Android 4.x

Docs and Website

Pure’s website is also open source, so please open any issues or pull requests for the docs and website over at the pure-site repository.


See the CONTRIBUTING file for information on how to contribute to Pure.


This software is free to use under the Yahoo! Inc. BSD license. See the LICENSE file for license text and copyright information.


转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]



Get value of multiselect box using jQuery or pure JS
Karol SelakHulk提出了一个问题:Get value of multiselect box using jQuery or pure JS,或许与您遇到的问题类似。 回答者prodigitalson给出了该问题的处理方式: th...
[译] 何时使用Component还是PureComponent?
原文:When to use Component or PureComponent? 何时使用Component还是PureComponent? 我开始转向使用PureCompoent是因为它是一个更具性能的Component的版本。虽...
浅谈 TypeScript - PureComponent
我们都知道 React 的刷新机制,因此如果每一次的变动都要刷新一下界面,这对于应用程序的性能来说是一个非常不科学的事情,因此在没有 PureComponent 之前,我们都需要手动使用 shouldComponentUpdate?(nex...
Pure Javascript - store object in cookie
BenjaminShlomo提出了一个问题:Pure Javascript - store object in cookie,或许与您遇到的问题类似。 回答者Beat Richartz给出了该问题的处理方式: Try that one to...
pure javascript to check if something has hover (without setting on mouseover/out)
Carles Alcoleamulllhausen提出了一个问题:pure javascript to check if something has hover (without setting on mouseover/out),或许与您...
React 的 PureComponent Vs Component
一.它们几乎完全相同,但是PureComponent通过prop和state的浅比较来实现shouldComponentUpdate,某些情况下可以用PureComponent提升性能 1.所谓浅比较(shallowEqual),即reac...
Add elements to the DOM given plain text HTML using only pure JavaScript (no jQuery)
kirps提出了一个问题:Add elements to the DOM given plain text HTML using only pure JavaScript (no jQuery),或许与您遇到的问题类似。 回答者maeric...
How to make HTML element resizable using pure javascript?
Philippe Plantiermonk提出了一个问题:How to make HTML element resizable using pure javascript?,或许与您遇到的问题类似。 回答者user123444555621给...
Hide element by class in pure Javascript [duplicate]
hichris123Harry提出了一个问题:Hide element by class in pure Javascript [duplicate],或许与您遇到的问题类似。 回答者c.P.u1给出了该问题的处理方式: document....