Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Update Modularscale to 3 #49

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .bowerrc

This file was deleted.

3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ profile

#ignore packages
node_modules
bower_components
*.log

sassdoc
sassdoc
1 change: 0 additions & 1 deletion Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ gulp.task('sass', function() {
.pipe(customPlumber())
.pipe(sass({
includePaths: [
'./bower_components/',
'./node_modules/',
'./'
],
Expand Down
30 changes: 0 additions & 30 deletions bower.json

This file was deleted.

2 changes: 1 addition & 1 deletion css/create-class.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
line-height: 1.5; }

.h1 {
font-size: 6.8541rem;
font-size: 5.0625rem;
line-height: 1.3; }
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,10 @@
"url": "https://github.com/zellwk/typi"
},
"author": "Zell Liew <[email protected]>",
"license": "MIT"
"license": "MIT",
"dependencies": {
"breakpoint-sass": "^2.7.1",
"mappy-breakpoints": "^0.2.3",
"modularscale-sass": "^3.0.5"
}
}
2 changes: 1 addition & 1 deletion scss/_public.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@import 'public/rhythm/rhythm';
@import 'public/typi/typi';
@import 'public/typefaces/typefaces';
@import 'public/typefaces/typefaces';
4 changes: 2 additions & 2 deletions scss/private/calc/_calc-ms-size.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
$_is-ratio: _ty-is-ratio($ms-setting);

@if $_is-ratio {
@return ms($step, 1em, $ms-setting);
@return ms($step, $base: 1em, $ratio: $ms-setting);
} @else {
@error "$typi-ms ratio at #{$breakpoint} must be unitless";
}
Expand Down Expand Up @@ -61,7 +61,7 @@
@error "$typi-ms at #{$breakpoint} must contain at least one ratio";
}

@return ms($step, $ty-ms-base, $ty-ms-ratio);
@return ms($step, $base: $ty-ms-base, $ratio: $ty-ms-ratio);
}
}

Expand Down
6 changes: 3 additions & 3 deletions test/automated/_calc-font-sizes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@ $basemap: map-get($typi, base);
@include test('unitless -> rem') {
$test: _ty-ms-to-rem(2, small);
$ratio: map-get($typi-ms, small);
$result: _ty-strip-unit(ms(2, 1em, $ratio)) * 1rem;
$result: _ty-strip-unit(ms(2, $base: 1em, $ratio: $ratio)) * 1rem;
@include assert-equal($test, $result);
}

@include test('unitless -> em') {
$test: _ty-ms-to-em(2, med);
$ratio: map-get($typi-ms, med);
$result: ms(2, 1em, $ratio);
$result: ms(2, $base: 1em, $ratio: $ratio);
@include assert-equal($test, $result);
}
}
}
8 changes: 4 additions & 4 deletions test/automated/_typefaces.scss
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ $typi-ms: (
@include test-module('vr-ms with typefaces') {
@include test('write one property') {
@include assert('') {
@include input {
@include output {
@include vr-ms(margin-top, 2, 'vr-ms-test', 'secondary');
}
@include expect {
Expand All @@ -187,7 +187,7 @@ $typi-ms: (
@include test-module('Typeface output:') {
@include test('should produce right font-size values') {
@include assert('') {
@include input {
@include output {
@include typi('secondary', $typeface: 'secondary');
}

Expand All @@ -203,7 +203,7 @@ $typi-ms: (
@include test('should produce right rhythm values') {
@include assert('') {
$font-size: nth(map-fetch($typi, secondary null), 1);
@include input {
@include output {
margin-top: vr(3, $font-size, 'secondary');
}
@include expect {
Expand All @@ -213,4 +213,4 @@ $typi-ms: (
}
}
}
}
}
4 changes: 2 additions & 2 deletions test/automated/_typi-ms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ $typi-ms: (
@include assert-equal($test, $result);
}

// Hardcoded test
Hardcoded test
@include test('for 2 bases') {
$test: _ty-calc-ms(2, double-base);
$result: ms(2, 2em 3em, 1.2);
Expand Down Expand Up @@ -75,7 +75,7 @@ $typi-ms: (
@include test-module('Writing Typi MS props') {
@include test('should output font-size and line-height') {
@include assert('') {
@include input {
@include output {
@include _ty-output-props((
target: 'h1',
target-map: map-get($typi, 'h1'),
Expand Down
10 changes: 5 additions & 5 deletions test/automated/_write-props.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ $basemap: map-get($typi, base);
@include test-module('Write properties') {
@include test('font-size only') {
@include assert('h1 null breakpoint') {
@include input {
@include output {
@include _ty-output-props((
target: 'h1',
target-map: map-get($typi, 'h1'),
Expand All @@ -44,7 +44,7 @@ $basemap: map-get($typi, base);

@include test('font-size and line-height') {
@include assert('h1 med breakpoint') {
@include input {
@include output {
@include _ty-output-props((
target: 'h1',
target-map: map-get($typi, 'h1'),
Expand All @@ -64,7 +64,7 @@ $basemap: map-get($typi, base);

@include test('list type for font-size in map') {
@include assert('h1 large breakpoint') {
@include input {
@include output {
@include _ty-output-props((
target: 'h1',
target-map: map-get($typi, 'h1'),
Expand All @@ -84,7 +84,7 @@ $basemap: map-get($typi, base);

@include test('write base font-size') {
@include assert('base') {
@include input() {
@include output() {
@include _ty-output-props((
target: 'base',
target-map: map-get($typi, 'base'),
Expand All @@ -100,4 +100,4 @@ $basemap: map-get($typi, base);
}
}
}
}
}
4 changes: 2 additions & 2 deletions test/automated/extender.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import 'true';
@import 'modular-scale/stylesheets/_modular-scale';
@import 'node_modules/modularscale-sass/stylesheets/_modularscale';
@import 'scss/typi';

// Test individual extension of maps
Expand Down Expand Up @@ -70,4 +70,4 @@ $typi-ms: (
);
@include assert-equal($test2, $result2, 'for h1')
}
}
}
2 changes: 1 addition & 1 deletion test/automated/test.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import 'true';
@import 'bower_components/modular-scale/stylesheets/_modular-scale';
@import 'node_modules/modularscale-sass/stylesheets/_modularscale';
@import 'scss/typi';

@import 'breakpoints';
Expand Down
2 changes: 1 addition & 1 deletion test/manual/baseline.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import 'scss/typi';
@import 'mappy-breakpoints/mappy-breakpoints';
@import 'compass-breakpoint/stylesheets/breakpoint';
@import 'node_modules/breakpoint-sass/stylesheets/breakpoint';

$breakpoints: (
small: 400px,
Expand Down
4 changes: 2 additions & 2 deletions test/manual/bp.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import 'scss/typi';
@import 'mappy-breakpoints/mappy-breakpoints';
@import 'compass-breakpoint/stylesheets/breakpoint';
@import 'node_modules/breakpoint-sass/stylesheets/breakpoint';

$breakpoints: (
small: 400px,
Expand Down Expand Up @@ -37,4 +37,4 @@ $typi-breakpoint: mappy-bp;
$typi-breakpoint: breakpoint;
.h1 {
@include typi(h1);
}
}
2 changes: 1 addition & 1 deletion test/manual/create-class.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import 'scss/typi';
@import 'modular-scale/stylesheets/_modular-scale';
@import 'node_modules/modularscale-sass/stylesheets/_modularscale';

$typi: (
base: (
Expand Down
4 changes: 2 additions & 2 deletions test/manual/typi-ms-vr.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import 'modular-scale/stylesheets/_modular-scale';
@import 'node_modules/modularscale-sass/stylesheets/_modularscale';
@import 'scss/typi';

$typi: (
Expand Down Expand Up @@ -26,4 +26,4 @@ $typi-ms: (

.testing {
@include vr-ms(margin-top, 2, $target: 'h1');
}
}
4 changes: 2 additions & 2 deletions test/manual/typi-ms.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import 'bower_components/modular-scale/stylesheets/_modular-scale';
@import 'node_modules/modularscale-sass/stylesheets/_modularscale';
@import 'scss/typi';

$breakpoints: (
Expand Down Expand Up @@ -63,4 +63,4 @@ h2 {

h2 {
@include typi('h2', $rem: false);
}
}
1 change: 0 additions & 1 deletion test/test_sass.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ testFiles.forEach(basename => {
sassTrue.runSass({
file: testFile,
includePaths: [
'./bower_components',
'./node_modules'
]
}, describe, it)
Expand Down