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

Kickoff v9 #192

Open
wants to merge 42 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
960356d
:fire: remove
mrmartineau May 14, 2017
90282a0
Merge branch 'master' into next
mrmartineau May 14, 2017
bc832f7
update the browserslist to be more relevant
mrmartineau May 16, 2017
8b55fc8
:bug: move invalid package.json `repo` to be `repository.page`
mrmartineau May 16, 2017
6e6af3f
:sparkles: use sass map for color main color-palette
mrmartineau May 16, 2017
66cfcfe
:sparkles: improve global sass vars
mrmartineau May 16, 2017
cf6d4cb
:hammer: update other sass files to use new functions etc
mrmartineau May 16, 2017
f71b23a
:hammer: sass typography refactored a bit
mrmartineau May 16, 2017
5b65518
:hammer: reorganise and group helper classes
mrmartineau May 16, 2017
7e579b7
:sparkles: add new mixin call to responsive helper classes
mrmartineau May 16, 2017
fb54d54
:hammer: use new color function
mrmartineau May 16, 2017
d9dc4c6
:memo: update readme
mrmartineau May 16, 2017
e21ecfa
:package: remove release-it dependency
mrmartineau May 16, 2017
250b00f
:package: use newer version of kickoff sass utils
mrmartineau May 16, 2017
7ee8fff
add npm run task to debug CSS compilation
mrmartineau May 16, 2017
b0bf512
:package: bump npm dependencies
mrmartineau May 16, 2017
c36b6b1
:package: bump npm dependencies
mrmartineau May 16, 2017
bcc4a19
Merge branch 'next' of github.com:TryKickoff/kickoff into next
mrmartineau May 16, 2017
6d6b065
:sparkles: add reference to new type size helper class mixins
mrmartineau May 18, 2017
aaeaf17
:hammer: use `ko-multiply` function
mrmartineau May 18, 2017
d6542d2
:hammer: use `ko-rem` function for font-sizing instead of the mixin
mrmartineau May 18, 2017
02880b3
:package: bump npm deps
mrmartineau May 18, 2017
56fc151
:sparkles: add `base` value to `$type` map
mrmartineau May 18, 2017
f17f290
:heavy_plus_sign: add `postcss-pxtorem`
mrmartineau May 21, 2017
4255e29
:hammer: update to new `ko-multiply` syntax
mrmartineau May 21, 2017
4ba354f
:hammer: switch `ko-rem` function to new `ko-font-size`
mrmartineau May 21, 2017
52301fd
add pxtorem config
mrmartineau May 21, 2017
7550023
update to use 3rd party modularscale config and functions
mrmartineau May 21, 2017
bd09285
:hammer: font-size vars have been simplified
mrmartineau May 21, 2017
8aef495
use update `font-size` values
mrmartineau May 21, 2017
fb96351
move the `ko-type-size` definition and add better explanation
mrmartineau May 21, 2017
5f362fc
:lipstick: move blockquote styles into new file
mrmartineau May 21, 2017
c0351b4
update styleguide with latest changes
mrmartineau May 21, 2017
324baa2
:rotating_light: fix linting error
mrmartineau May 21, 2017
5888c46
:arrow_up: update npm dependencies
mrmartineau May 21, 2017
f4dd8ab
:package: update utils dependency
mrmartineau Jun 4, 2017
fec0284
:memo: add more obvious cta for font-size helpers
mrmartineau Jun 4, 2017
09c82ee
:lipstick: add `$font-weight-normal` var so we can more easily use a …
mrmartineau Jun 4, 2017
86e94f5
styleguide: move sgVar mixin into own file
mrmartineau Jun 4, 2017
0638f0e
styleguide: add headings
mrmartineau Jun 4, 2017
d0d620f
:bug: styleguide: fix type size copy value
mrmartineau Jun 4, 2017
5449b69
flair
mrmartineau Jun 7, 2017
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
13 changes: 12 additions & 1 deletion .kickoff/tasks/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const path = require('path');
const autoprefixer = require('autoprefixer');
const cssnano = require('cssnano');
const flexbugsFixes = require('postcss-flexbugs-fixes');
const pxtorem = require('postcss-pxtorem');

const config = require('../config');

Expand All @@ -30,7 +31,13 @@ gulp.task('css', () => {
// Sass Compilation
.pipe(
sass(
eyeglass()
eyeglass({
// put node-sass options you need here.

eyeglass: { // eyeglass options
root: __dirname,
}
})
).on('error', sass.logError)
)

Expand All @@ -39,6 +46,10 @@ gulp.task('css', () => {
postcss([
flexbugsFixes(),
autoprefixer({browsers: config.css.browsers}),
pxtorem({ // See other options at https://github.com/cuth/postcss-pxtorem#options
rootValue: 20,
selectorBlackList: ['html'],
}),
])
)

Expand Down
8 changes: 4 additions & 4 deletions assets/src/scss/_helper-classes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@
*/
.l-mb0 { margin-bottom: 0 !important; }
.l-mb1 { margin-bottom: $baseline !important; }
.l-mb2 { margin-bottom: ko-multiply($baseline, 2) !important; }
.l-mb3 { margin-bottom: ko-multiply($baseline, 3) !important; }
.l-mb2 { margin-bottom: ko-multiply(2) !important; }
.l-mb3 { margin-bottom: ko-multiply(3) !important; }

.l-mt0 { margin-top: 0 !important; }
.l-mb1 { margin-top: $baseline !important; }
.l-mb2 { margin-top: ko-multiply($baseline, 2) !important; }
.l-mb3 { margin-top: ko-multiply($baseline, 3) !important; }
.l-mb2 { margin-top: ko-multiply(2) !important; }
.l-mb3 { margin-top: ko-multiply(3) !important; }

/**
* Typography helpers
Expand Down
85 changes: 28 additions & 57 deletions assets/src/scss/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
*/

html {
font-size: #{$font-size-base - 2}px;
font-size: $font-size-base - 2;
-webkit-text-size-adjust: 100%;
// font-variant-ligatures: common-ligatures;
-webkit-font-smoothing: antialiased;

// This needs to come after -webkit-font-smoothing
// stylelint-disable-next-line declaration-block-properties-order
-moz-osx-font-smoothing: grayscale;
text-size-adjust: 100%;
text-rendering: optimizeLegibility;
text-size-adjust: 100%;
text-rendering: optimizeLegibility;

@include media('>m') {
font-size: #{$font-size-base}px;
font-size: $font-size-base;
}
}

Expand Down Expand Up @@ -62,55 +62,46 @@ h6 {
margin-bottom: $baseline;
}

// Uncomment to include font-size helper classes
// See https://github.com/TryKickoff/kickoff-utils.scss#_type-sizesscss
// for more info
// Usage:
@include ko-type-sizes();
// @include ko-type-sizes($type, (h1: xxl, h2: xl, h3: l, h4: m));

// Use the helper classes to emulate styles for another element
// For example: h3.h1 or h3.alpha
h1 {
font-size: ko-rem(xl);
margin-bottom: ko-multiply($baseline, 2);
font-size: ko-font-size(xl);
margin-bottom: ko-multiply(2);

@include media('>m') {
font-size: ko-rem(xxl);
font-size: ko-font-size(xxl);
}
}

h2 {
font-size: ko-rem(l);
font-size: ko-font-size(l);

@include media('>m') {
font-size: ko-rem(xl);
font-size: ko-font-size(xl);
}
}

h3 {
font-size: ko-rem(m);
font-size: ko-font-size(m);

@include media('>m') {
font-size: ko-rem(l);
font-size: ko-font-size(l);
}
}

h4 {
font-size: ko-rem(s);
font-size: ko-font-size(s);

@include media('>m') {
font-size: ko-rem(m);
font-size: ko-font-size(m);
}
}

h5,
h6 {
font-size: ko-rem(s);
font-size: ko-font-size(s);
margin-bottom: 0;

@include media('>m') {
font-size: ko-rem(m);
font-size: ko-font-size(m);
}
}

Expand All @@ -124,6 +115,19 @@ h6 {
margin-top: $baseline;
}

/**
* font-size helper classes
* See https://github.com/TryKickoff/kickoff-utils.scss#_type-sizesscss
* for more info
*
* Usage:
* @include ko-type-sizes();
* @include ko-type-sizes($type, (h1: 50px, h2: 35px, h3: l, h4: m));
*
* Uncomment the line below to include
*/
// @include ko-type-sizes();

small {
font-size: 80%;
}
Expand All @@ -149,39 +153,6 @@ abbr[title] {
cursor: help;
}

/**
* Blockquotes
*/
blockquote {
padding-left: 10px;
margin: $baseline;
border-left: 4px solid lighten(#000, 80%);

p {
margin-bottom: 0;
font-size: ko-rem(m);
font-weight: 300;
}

small {
display: block;
color: lighten(#000, 70%);

&::before {
content: '\2014 \00A0';
}
}
}

// Quotes
q,
blockquote {
&::before,
&::after {
content: "";
}
}

// Prevents sub and sup affecting line-height in all browsers
// gist.github.com/413930
sub,
Expand Down
42 changes: 25 additions & 17 deletions assets/src/scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,47 @@
* - App-specific
*/

// stylelint-disable indentation

/**
* Typography
* =================================
*
* Base sizes:
* Set this in pixels (but do not add px),
* the font-size mixin will convert to REMS
* 🚨 If you change the $font-size-base value, you will also need
* to update the pxtorem `rootValue` in `.kickoff/css.js`
*/
$font-size-base: 20;
$font-size-base: 20px; // 🚨 Read above if you change this
$leading-base: 1.4;
$line-height-base: round($font-size-base * $leading-base); // 20 * 1.4
$baseline: $line-height-base * 1px;
$baseline: round($font-size-base * $leading-base); // 20 * 1.4

$type-scale: 1.25; // 1.25 === Major third. See modularscale.com
$modularscale: ( // From https://github.com/modularscale/modularscale-sass/
base: 20px 25px,
ratio: 1.5 // 1.25 === Major third. See modularscale.com
);

/**
* Type sizes
* Type sizes $map
* =================================
* Set using a modular scale by default.
* Values can be changed to px, rem etc if needed
* Kickoff's type is set using sizes defined in this
* Sass map. They are set using a modular scale by
* default, but values can be changed to px, rem etc if needed
*
* Usage:
* font-size: ko-font-size(base);
* font-size: ko-font-size(xl);
*
* Use the ms() function if you want to size fonts
* indepently using the modular scale. See
* https://github.com/modularscale/modularscale-sass for more info
*/
$type: (
xs: ko-ms(-2),
s: ko-ms(-1),
base: ko-ms(0), // [default] p, h5, h6
m: ko-ms(1), // h4
l: ko-ms(2), // h3
xl: ko-ms(3), // h2
xxl: ko-ms(4) // h1
xs: ms(-2),
s: ms(-1),
base: ms(0), // [default] p, h5, h6
m: ms(1), // h4
l: ms(2), // h3
xl: ms(3), // h2
xxl: ms(4) // h1
);

/**
Expand Down
2 changes: 1 addition & 1 deletion assets/src/scss/components/_code.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ code,
pre {
padding: 0 3px 2px;
font-family: ko-font(mono);
font-size: ko-rem(s);
font-size: ko-font-size(s);
color: $code-textColor;
border-radius: 3px;
tab-size: 3;
Expand Down
13 changes: 8 additions & 5 deletions assets/src/scss/components/_lists.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ ol {

// Unordered and Ordered lists
// Add a .unstyled class to unordered/ordered lists if you want them to have bullets/numbers
ul, ol {
ul,
ol {
padding: 0;
margin: 0 0 $baseline $baseline;

ul,
ol {
margin-left: ko-multiply($baseline, 2);
margin-left: ko-multiply(2);
}

ul {
Expand All @@ -43,7 +44,8 @@ ul, ol {
}
}

ul, ol {
ul,
ol {
margin-bottom: 0;
}
}
Expand Down Expand Up @@ -76,7 +78,8 @@ dd { margin-left: $baseline; }
</ul>
*/

.l-list--centred, .l-list--centered {
.l-list--centred,
.l-list--centered {
text-align: center;

li {
Expand All @@ -97,7 +100,7 @@ dd { margin-left: $baseline; }
@include ko-clearfix;

li {
float: left;
// float: left;
display: inline-block;
}
}
39 changes: 39 additions & 0 deletions assets/src/scss/components/_quotes.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**
* Blockquotes
* =====================
*
* Usage:
<blockquote>
<p>Quoted text</p>
<small>Citation</small>
</blockquote>
*/
blockquote {
padding-left: 10px;
margin: $baseline;
border-left: 4px solid ko-color(text, light);

p {
margin-bottom: 0;
font-size: ko-font-size(m);
font-weight: 300;
}

small {
display: block;
color: ko-color(text, light);

&::before {
content: '\2014 \00A0';
}
}
}

// Remove quotation marks if something else is adding them
q,
blockquote {
&::before,
&::after {
content: "";
}
}
2 changes: 1 addition & 1 deletion assets/src/scss/components/_tables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ th {
.responsiveTable {
@include media('<m') {
width: 100%;
margin-bottom: #{ko-multiply($baseline, 0.75)}px;
margin-bottom: ko-multiply(0.75);
overflow-y: hidden;
overflow-x: auto;
-ms-overflow-style: -ms-autohiding-scrollbar;
Expand Down
Loading