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

flex-layout

v1.0.1

Published

CSS3 Flexbox layout

Downloads

3,320

Readme

#flex-layout

基于flexbox的栅格化布局库,提供更直观、丰富的布局方式。 文档与demo

#npm npm install flex-layout

#优势

flex-layout解决了css布局的不少问题:

  • 应用一个class就可以垂直居中。
  • 轻松实现多栏同高。
  • 自动计算间距,实现等宽布局,不需要再计算margin。
  • 支持自动填充剩余宽度,以往我们需要通过触发BFC来实现。
  • 支持自动填充剩余高度,比如将footer置于底部。
  • 随意调整[栅格]顺序,比如让main比sidebar提前渲染出来。
  • 丰富的对齐方式:上、下、左、右、左上、右上、左下、右下。

#概述

与传统的栅格化一样,flex-layout基于容器(相当于Bootstrap的row) 和栅格(相当于Bootstrap的column) 来布局:

  • [容器]有两种: flex-column: 容器里的[栅格]以横向排列,与传统栅格化的row一样 flex-row: 容器里的[栅格]以竖向排列,就像header、content、footer的排列一样

  • 通常,只有[栅格]可以直接放在[容器]中,而你的内容应该放在[栅格]里。但这不是必须的,直接把内容放在[容器]里也没问题。

  • 如果一个[容器]里包含的[栅格]超过24格,多出的部分将另起一行。

  • IE的话只兼容IE10+,其他主流浏览器都支持。

  • Flexbox有主轴,副轴的概念,flex-layout已经封装好了,你不需要懂得flexbox,也无需针对不同轴使用不同的class。不过,如果你对Flexbox有所了解的话,用起来会更顺手。

  • 与Bootstrap等栅格化不同的是:flex-layout不需要container,栅格本身不自带padding。

#License

MIT