• This repository has been archived on 11/Mar/2021
  • Stars
    star
    134
  • Rank 270,967 (Top 6 %)
  • Language
    CSS
  • Created over 10 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Modular grid powered by Lost and BEM

Sharps

Modular grid powered by Lost and BEM

Usage

The easiest way:

  1. bower install --save sharps
  2. <link rel="stylesheet" href="./bower_components/sharps/dist/sharps.min.css">

As plugin for postcss:

  1. npm i --save sharps
  2. Prepend your plugins with sharps
const postcss = require('postcss');
const sharps = require('sharps').postcss;

postcss([sharps({
  columns: 12, // default
  maxWidth: '1100px',
  gutter: '10px',
  flex: 'flex'
})]).process('a {color: red}').then(function(result) {
  console.log(result.css);
});

As ENB module:

  1. npm i --save-dev sharps
  2. Add sharps in your ENB config
[require('sharps').enb, {
  config: {
    columns: 12, // default
    maxWidth: '1100px',
    gutter: '10px',
    flex: 'flex'
  }
}]

Note: If you have any css builder, you should change its target and add source to sharps parameters for preventing conflicts, like this:

[techs.stylus, {
  target: '?.no-grid.css', // there is the changed target
  sourcemap: false,
  autoprefixer: {
    browsers: ['ie >= 10', 'last 2 versions', 'opera 12.1', '> 2%']
  }
}],

[require('sharps').enb, {
  config: {
    maxWidth: '1100px',
    gutter: '10px',
    flex: 'flex'
  },
  source: '?.no-grid.css' // there is the source
}]

Easy example

<div class="row">
    <div class="row__col row__col_mw_6">left column</div>
    <div class="row__col row__col_mw_6">right column</div>
</div>
{
  block: 'row',
  content: [
    {
      elem: 'col',
      elemMods: { mw: 6 },
      content: 'left column'
    },
    {
      elem: 'col',
      elemMods: { mw: 6 },
      content: 'right column'
    }
  ]
}

Options

Useful mods for row block:

  • (s|m|l|xl|xxl)al - align cols to left on needed displays

  • (s|m|l|xl|xxl)ac - align cols to center on needed displays

  • (s|m|l|xl|xxl)ar - align cols to right on needed displays

  • (s|m|l|xl|xxl)vat - align cols vertically to top on needed displays

  • (s|m|l|xl|xxl)vam - align cols vertically to middle on needed displays

  • (s|m|l|xl|xxl)vab - align cols vertically to bottom on needed displays

Useful mods for col element:

  • (s|m|l|xl|xxl) - auto width on needed displays

  • (s|m|l|xl|xxl)w - width on needed displays, 0 hide col on this device

  • (s|m|l|xl|xxl)o - offset on needed displays

  • (s|m|l|xl|xxl)of - order first this col on needed displays

  • (s|m|l|xl|xxl)ol - order last this col on needed displays

Authors

Ideas

Please, talk about your ideas by GitHub issues.

MIT License

More Repositories

1

bem-on-rails

BEM methodology for Rails applications
Ruby
65
star
2

generator-bem-ng

Yeoman generator for AngularJS applications on BEM methodology
JavaScript
30
star
3

cra-ssr-boilerplate

Create React App by Facebook with stream SSR, HMR, TypeScript and live rebuilding
TypeScript
27
star
4

react-bl

React components powered by XJST
JavaScript
24
star
5

bem-ng

Library for work with AngularJS in bem-projects
JavaScript
15
star
6

enb-postcss

PostCSS for ENB
JavaScript
11
star
7

aviasales

TypeScript
9
star
8

posthtml-extend-attrs

Transform html attrs with css properties to svg attrs
JavaScript
8
star
9

posthtml-to-svg-tags

Transform html tags to svg tags
JavaScript
8
star
10

bem-content

BEM blocks for right work with content
JavaScript
6
star
11

jo-cli

Jo — command line code generator that works.
TypeScript
5
star
12

really-typed-compose

Definitely typed and simple implementation of function composition
TypeScript
5
star
13

alfa-bank-ui

Alfa-Bank UI implementation (BEMHTML, PostCSS, i-bem.js)
JavaScript
5
star
14

easy-bem-naming

DEPRECATED! Use recn intead.
TypeScript
3
star
15

react-xjst

DEPRECATED: use https://github.com/awinogradov/ddsl-react
JavaScript
3
star
16

postcss-bem-validator

PostCSS plugin to validate BEM names
JavaScript
3
star
17

xjst-ddsl

DDSL Engine for XJST
JavaScript
2
star
18

xjst-benchmarks

JavaScript
2
star
19

posthtml-bemjson

Convert PostHTML tree to BEMJSON tree
JavaScript
2
star
20

bemup-spb

Application prototyping with BEM
JavaScript
2
star
21

sync-icons

JavaScript
1
star
22

bem-composition

TypeScript
1
star
23

master-bank-static

Recent works and secret projects copies
JavaScript
1
star
24

recn

Blazing fast. Tiny size < 200 B. The last one BEM className helper.
TypeScript
1
star
25

condicom

Apply React component enhancements by condition
TypeScript
1
star
26

react-jo-templates

React templates for Jo
JavaScript
1
star
27

avinogradov.com

Personal website
JavaScript
1
star
28

ddsl-react

Apply ddsl to React components in runtime
JavaScript
1
star