bemify 0.0.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/README.md +34 -17
- data/lib/bemify.rb +2 -2
- data/sass/_bemify.scss +5 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YWM0NDAwZDQ1MzVmNjVkZTAxM2FmYWI2ZjllOWFjZDUwMTQ5MWNjMA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZGEwNDgyNDlmNWIwMGU5N2JmNTdkNmQyZjUzMzA4YWYyZmNjOTQ2Nw==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MGMzYTM1MTBiMjhiNzU5OGQyZDM1ZTJlYTA2OGIxYmQ2ZGFjMmM1MTBiMTYy
|
10
|
+
ODVkZDIzM2Q5ZjkxNjJiZjkwNWZiNzQ2NjRiMGU3NjUwNmUwMGNjZTQ2MmJj
|
11
|
+
NmZmZDE3ZWExMDA0OGE3ZTRmMTA3NGZlOTljMTE3MTZkZDM3NTI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YTUyMmEyZDMzN2Q5ZDMwYjhkM2U0YmYwNTkzZDJkZmRkZDczNGNiMWY4Yjgz
|
14
|
+
NmI2ZmQ1YjUwZTFiMDM5NDlhZGZhOGMxZTkxZTk0NWMxN2QyNmQxMTgwOWYw
|
15
|
+
OWUxZjUyZjYyOWRlZTBiNzViMDAxNTlmMjNhZGQ4ZDY3MTRjYmM=
|
data/README.md
CHANGED
@@ -2,24 +2,33 @@
|
|
2
2
|
|
3
3
|
[](https://img.shields.io/bower/v/bemify.svg)
|
4
4
|
[](https://img.shields.io/gem/v/bemify.svg)
|
5
|
+
[](https://img.shields.io/npm/v/bemify.svg)
|
5
6
|
|
6
|
-
Bemify is a set of mixins to help you write well-structured, readable, maintainable, component-based modular SCSS source using a BEM-style syntax.
|
7
|
+
Bemify is a set of Sass mixins to help you write well-structured, readable, maintainable, component-based modular SCSS source using a BEM-style syntax.
|
7
8
|
|
9
|
+
__Bemify site & documentation: [http://franzheidl.github.io/bemify/](http://franzheidl.github.io/bemify/)__
|
8
10
|
|
11
|
+
Bemify supports [libsass](https://github.com/sass/libsass) since libsass 3.2.4.
|
9
12
|
## Install
|
10
13
|
|
11
|
-
Bemify can be installed as a Ruby Gem, via [Bower](http://bower.io), or manually.
|
14
|
+
Bemify can be installed as a [Ruby Gem](https://rubygems.org/gems/bemify), via [Bower](http://bower.io/search/?q=bemify), [NPM](https://www.npmjs.com/package/bemify), or manually. As a NPM module, bemify supports [eyeglass](https://github.com/sass-eyeglass/eyeglass). Bemify is also on [Sache.in](http://www.sache.in/search?query=bemify).
|
15
|
+
|
12
16
|
|
13
17
|
### Bower
|
14
18
|
To install via bower run:
|
15
19
|
|
16
|
-
$ bower install --save-dev
|
20
|
+
$ bower install bemify --save-dev
|
17
21
|
|
18
22
|
### Ruby Gem
|
19
23
|
When installed as a Ruby Gem, Bemify will be installed as a Compass extension if Compass is installed on your system.
|
20
24
|
|
21
25
|
$ gem install bemify
|
22
26
|
|
27
|
+
### npm
|
28
|
+
To install via npm run:
|
29
|
+
|
30
|
+
$npm install bemify --save-dev
|
31
|
+
|
23
32
|
### Manual Install
|
24
33
|
Include `sass/_bemify.scss`in the appropriate location in your project.
|
25
34
|
|
@@ -83,19 +92,21 @@ The mixins can be nested to create modifiers for subcomponents:
|
|
83
92
|
@include block('my-element') {
|
84
93
|
|
85
94
|
@include element('child') {
|
95
|
+
…
|
86
96
|
@include modifier('bad') {
|
97
|
+
…
|
87
98
|
@include state('happy') {
|
88
|
-
|
99
|
+
…
|
89
100
|
}
|
90
101
|
}
|
91
102
|
}
|
92
103
|
|
93
104
|
@include modifier('large') {
|
94
|
-
|
105
|
+
…
|
95
106
|
}
|
96
107
|
|
97
108
|
@include state('active') {
|
98
|
-
|
109
|
+
…
|
99
110
|
}
|
100
111
|
|
101
112
|
}
|
@@ -103,23 +114,23 @@ The mixins can be nested to create modifiers for subcomponents:
|
|
103
114
|
This will result in:
|
104
115
|
|
105
116
|
.my-element {
|
106
|
-
|
117
|
+
…
|
107
118
|
}
|
108
119
|
|
109
120
|
.my-element__child {
|
110
|
-
|
121
|
+
…
|
111
122
|
}
|
112
123
|
|
113
124
|
.my-element__child--bad {
|
114
|
-
|
125
|
+
…
|
115
126
|
}
|
116
127
|
|
117
128
|
.my-element__child--bad.is-happy {
|
118
|
-
|
129
|
+
…
|
119
130
|
}
|
120
131
|
|
121
132
|
.my-element--large {
|
122
|
-
|
133
|
+
…
|
123
134
|
}
|
124
135
|
|
125
136
|
.my-element.is-active {
|
@@ -143,16 +154,17 @@ Bemify can can of course also be used inside any scope:
|
|
143
154
|
|
144
155
|
### Configuration Options
|
145
156
|
|
146
|
-
bemify uses
|
147
|
-
To overwrite bemify's config with your own configuration file, import your
|
157
|
+
bemify uses some configuration variables where to adjust the block-element and the state separator, as well as the state prefix.
|
158
|
+
To overwrite bemify's config with your own configuration file, just import your variables before using one of the mixins.
|
148
159
|
|
160
|
+
@import "your-variables";
|
149
161
|
@import "bemify";
|
150
|
-
@import "my_config";
|
151
162
|
|
152
163
|
@include block('my-block') {
|
153
|
-
|
164
|
+
…
|
154
165
|
}
|
155
166
|
|
167
|
+
|
156
168
|
Configurable options and their defaults are:
|
157
169
|
|
158
170
|
* `$combined-state-selectors`: `true`
|
@@ -171,7 +183,7 @@ Configurable options and their defaults are:
|
|
171
183
|
|
172
184
|
|
173
185
|
## Aliases
|
174
|
-
Not everyone thinks in the categories of 'block, element, modifier', but many of us still want to write modularized, components-based CSS. There are a couple of aliases included for those who think in terms of components, parent-child / -subcomponents included:
|
186
|
+
Not everyone thinks in the categories of 'block, element, modifier', but many of us still want to write modularized, components-based CSS. There are a couple of aliases included for those who think in terms of components, parent-child / -subcomponents included (And it's totally straightforward to add your own):
|
175
187
|
|
176
188
|
@include block('name') {}
|
177
189
|
== @include component('name') {}
|
@@ -186,9 +198,14 @@ Not everyone thinks in the categories of 'block, element, modifier', but many of
|
|
186
198
|
|
187
199
|
|
188
200
|
## Resources
|
201
|
+
Some highly recommended reading re CSS structure, decoupling markup and styles, BEM, and why this makes sense:
|
202
|
+
|
189
203
|
|
190
|
-
* [Harry Roberts: MindBEMding – getting your head ’round BEM syntax](http://csswizardry.com/2013/01/mindbemding-getting-your-head-round-bem-syntax/)
|
191
204
|
* [Nicolas Gallagher: About HTML semantics and front-end architecture](http://nicolasgallagher.com/about-html-semantics-front-end-architecture/)
|
205
|
+
* [Philip Walton: Side Effects in CSS](http://philipwalton.com/articles/side-effects-in-css/)
|
206
|
+
* [BEM official](http://getbem.com/)
|
207
|
+
* [Harry Roberts: MindBEMding – getting your head ’round BEM syntax](http://csswizardry.com/2013/01/mindbemding-getting-your-head-round-bem-syntax/)
|
208
|
+
|
192
209
|
|
193
210
|
|
194
211
|
---
|
data/lib/bemify.rb
CHANGED
data/sass/_bemify.scss
CHANGED
@@ -8,22 +8,22 @@
|
|
8
8
|
// CONFIG
|
9
9
|
// ======
|
10
10
|
|
11
|
-
// You can change the configuration here. To use your own config/variables file, import your
|
11
|
+
// You can change the configuration here. To use your own config/variables file, just import your variables before using one of the mixins.
|
12
12
|
|
13
13
|
// Output combined state selectors like:
|
14
14
|
// .block__element.is-active {}
|
15
15
|
// Set to false to output single, non-combined state modifiers:
|
16
16
|
// .block__element--is-active {}
|
17
|
-
$combined-state-selectors:
|
17
|
+
$combined-state-selectors: true !default;
|
18
18
|
|
19
19
|
// .block[separator]element:
|
20
|
-
$element-separator:
|
20
|
+
$element-separator: "__" !default;
|
21
21
|
|
22
22
|
// .block[separator]modifier:
|
23
|
-
$modifier-separator:
|
23
|
+
$modifier-separator: "--" !default;
|
24
24
|
|
25
25
|
// The default prefix for state modifier selectors, will be combined with $modifier-separator:
|
26
|
-
$state-prefix:
|
26
|
+
$state-prefix: "is" !default;
|
27
27
|
|
28
28
|
|
29
29
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bemify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Franz Heidl
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sass
|