Skip to content

Commit

Permalink
Merge branch 'release/0.7.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
HarwinBorger committed Mar 13, 2018
2 parents b4dfac7 + f108ccf commit fb47a2c
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 14 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "spaceframework",
"description": "Front-end development made for into Space!",
"version": "0.6.0",
"version": "0.7.0",
"main": "",
"authors": [
"Harwin Borger <harwin@studioborger.nl>"
Expand Down
9 changes: 9 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
#Changelog

## [0.7] Alignment classes - 13-03-2017

### Add
- Add align-baseline so you can specify where you want to apply baseline alignment from @HarwinBorger
- Add align-topline so you can specify where you want to apply topline alignment from @HarwinBorger

### Remove
- Remove default alignment of main elements.

## [0.6] Rework Font Presets - 12-03-2017
### Changed
- Rework of font-size variables to font-presets and mixin from @HarwinBorger
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "harwinborger/spaceframework",
"version": "0.6.0",
"version": "0.7.0",
"description": "Vertical grid system",
"keywords": [
"wordpress",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "spaceframework",
"version": "0.6.0",
"version": "0.7.0",
"author": "Harwin Borger <info@studioborger.nl>",
"licence": "GPL-3.0",
"devDependencies": {
Expand Down
28 changes: 23 additions & 5 deletions scss/2.tools/_space-font.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@
*
* @param $font-size-value (string)
* @param $line-height (list)
* @param $baseline (true | false | reset)
*
* TODO:
* todo 1: make sure all $space-units sizes are rendered because baseline correction
* todo 2: make $line-height work to overwrite default line-height
*/
@mixin space-font-preset($font-preset-value: default, $line-height: true, $baseline: true) {
$class-align-baseline: '.align-baseline' !default;
$class-align-topline: '.align-topline' !default; // TODO build in top alignment

@mixin space-font-preset($font-preset-value: default, $line-height: default, $baseline: true) {
$map-font-size: 1;
$map-line-height: 2;

Expand All @@ -29,8 +33,12 @@
$space-units: nth($font-preset, $map-line-height);
$line-height-value: convert-space-units($space-units, $breakpoint);

// Calculate baseline correction
$translate-y-value: 0; // Reset correction if $baseline is false. Needed in case inherit correction is applied
$translate-y-value: false;

// Reset baseline correction
@if ($baseline == reset) {
$translate-y-value: 0; // Reset correction if $baseline is false. Needed in case inherit correction is applied
}

// If translate text to baseline
@if ($baseline == true) {
Expand All @@ -40,13 +48,23 @@
}

// If line-height should be set
@if ($line-height == true) {
@if ($line-height != false) {
// Set line height
line-height: $line-height-value;
}

// Set translate for baseline correction
transform: translateY($translate-y-value);
@if ($translate-y-value != false) {
// Add element to .align-baseline object
#{$class-align-baseline} & {
transform: translateY($translate-y-value);
}

// Add element to .align-topline object
#{$class-align-topline} & {
transform: translateY(-$translate-y-value);
}
}
}

// Set font size
Expand Down
16 changes: 10 additions & 6 deletions scss/4.elements/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ p {

hr {
@include margin-vertical($distance-element, $distance-element);
@include height($distance-element);
@include height(1);

box-sizing: border-box;
}
Expand All @@ -42,7 +42,7 @@ blockquote {
border: 0;

@include margin-vertical(0, 0);
@include margin-horizontal($distance-element, $distance-element);
@include margin-horizontal($distance-element);

p {
@include font-preset(large);
Expand All @@ -57,10 +57,14 @@ blockquote {
}
}

:not(li) > ol,
:not(li) > ul{
ol,
ul{
@include font-preset();
@include margin-vertical($distance-element, $distance-element);
@include margin-vertical($distance-element);

& & {
@include margin-vertical(0)
}
}

button {
Expand All @@ -69,7 +73,7 @@ button {
}

table {
@include margin-vertical($distance-element, $distance-element);
@include margin-vertical($distance-element);
}

th,
Expand Down

0 comments on commit fb47a2c

Please sign in to comment.