modular-scale 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/changelog.md +5 -1
- data/lib/modular-scale.rb +1 -1
- data/readme.md +9 -7
- data/stylesheets/modularscale/_function.scss +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22773cbee288e14625c28b5f9219bf051ca6e8e5
|
4
|
+
data.tar.gz: 8a87f4e25420096cefc202a7b07329d73464980c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f8295fcfb0ddae63ef0a1e51e7b62723170a9270942f4dc027a544529b4d546fa2f7b3edded113832230617965a70b986bec841953ff1a89c67191e831bc0a2
|
7
|
+
data.tar.gz: 02db42d590cc4242e7a359c1b5494a42d1c7e9d8127bf7c3f8a38a07b09cddb5d9cd115d0567c9c382a79cac80af0a8c3b4033f7e2954eb6fb252ffaefb13e95
|
data/changelog.md
CHANGED
data/lib/modular-scale.rb
CHANGED
data/readme.md
CHANGED
@@ -4,7 +4,7 @@ A modular scale is a list of values that share the same relationship. These valu
|
|
4
4
|
|
5
5
|
Ems work especially well with modular scales as their recursive properties mimic modular scales making them more predictable and easier to manage. Pixels and other units work just fine and breakpoints in responsive web design can naturally fall on your scale to create better relevance to your text as all the values in your layout harmonize with each other.
|
6
6
|
|
7
|
-
To get started, you need to select a ratio and a base value. The base value is usually your text font size or 1em. Optionally you can add another value to create a double
|
7
|
+
To get started, you need to select a ratio and a base value. The base value is usually your text font size or 1em. Optionally you can add another value to create a double stranded modular scale which might be useful to create more options for in-between values. This base size paired with a ratio such as the golden ratio or any musical proportion will create your scale of values which all share this proportion.
|
8
8
|
|
9
9
|
## Install
|
10
10
|
|
@@ -12,29 +12,29 @@ To get started, you need to select a ratio and a base value. The base value is u
|
|
12
12
|
|
13
13
|
* Terminal: `gem install modular-scale --pre`
|
14
14
|
* Compass config: `require 'modular-scale'`
|
15
|
-
* SCSS: `@import '
|
15
|
+
* SCSS: `@import 'modularscale';`
|
16
16
|
|
17
17
|
### Eyeglass
|
18
18
|
|
19
19
|
* Terminal: `npm install modularscale-sass --save-dev`
|
20
|
-
* SCSS: `@import '
|
20
|
+
* SCSS: `@import 'modularscale'`
|
21
21
|
|
22
22
|
### Webpack with sass-loader
|
23
23
|
|
24
24
|
* Terminal: `npm install modularscale-sass --save-dev`
|
25
25
|
* Webpack config: install and use [sass-loader](https://github.com/jtangelder/sass-loader#apply-via-webpack-config)
|
26
|
-
* SCSS: `@import '~modularscale-sass/stylesheets/
|
26
|
+
* SCSS: `@import '~modularscale-sass/stylesheets/modularscale';`
|
27
27
|
|
28
28
|
### Bower
|
29
29
|
|
30
30
|
* Terminal: `bower install modular-scale --save-dev`
|
31
|
-
* SCSS: `@import '../link_to_component_dir/
|
31
|
+
* SCSS: `@import '../link_to_component_dir/modularscale';`
|
32
32
|
|
33
33
|
### Vanilla Sass
|
34
34
|
|
35
|
-
* [Download the latest zip](https://github.com/
|
35
|
+
* [Download the latest zip](https://github.com/modularscale/modularscale-sass/releases/latest)
|
36
36
|
* Extract into your project
|
37
|
-
* SCSS: `@import '
|
37
|
+
* SCSS: `@import 'modularscale';`
|
38
38
|
|
39
39
|
## Using modular scale
|
40
40
|
|
@@ -126,6 +126,8 @@ h2 {
|
|
126
126
|
|
127
127
|
If you do happen to have any values that are just named without numbers they will be ignored by the responsive mixin, it’s smart enough to just pull values that look like breakpoints.
|
128
128
|
|
129
|
+
Here is an [example page](http://skscratch.bitballoon.com/ms-demo) and the [corrisponding Sass](https://github.com/modularscale/modularscale-sass/blob/3.x/test-compass/sass/style.scss).
|
130
|
+
|
129
131
|
#### Note on non-integer values
|
130
132
|
|
131
133
|
Unfortunately [Sass doesn’t natively support exponents](https://github.com/sass/sass/issues/684#issuecomment-196852515). This isn’t all bad news, you can use either use [Compass](http://compass-style.org/), [mathsass](https://github.com/terkel/mathsass), or another library that has a `pow()` function that supports non-integer values and this plugin will pick up on that function and use it. You will then be able to write values like `ms(2.5)`. This is also a prerequisite for _target sizes_ below.
|
@@ -12,7 +12,7 @@
|
|
12
12
|
|
13
13
|
// Fast calc if not multi stranded
|
14
14
|
@if(length($base) == 1) {
|
15
|
-
@return ms-round-px(pow($ratio, $v) * $base);
|
15
|
+
@return ms-round-px(ms-pow($ratio, $v) * $base);
|
16
16
|
}
|
17
17
|
|
18
18
|
// Create new base array
|
@@ -49,5 +49,5 @@
|
|
49
49
|
// Find base to use in calculation
|
50
50
|
$ms-base: round(($v / length($ms-bases) - $vtep) * length($ms-bases)) + 1;
|
51
51
|
|
52
|
-
@return ms-round-px(pow($ratio, $vtep) * nth($ms-bases,$ms-base));
|
52
|
+
@return ms-round-px(ms-pow($ratio, $vtep) * nth($ms-bases,$ms-base));
|
53
53
|
}
|