This repository has been archived by the owner on Sep 16, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Loïc Goyet
committed
Apr 5, 2017
1 parent
8764086
commit 573d684
Showing
10 changed files
with
313 additions
and
29 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
@function square-root($r) { | ||
$x0: 1; | ||
$x1: $x0; | ||
|
||
@for $i from 1 through 10 { | ||
$x1: $x0 - ($x0 * $x0 - abs($r)) / (2 * $x0); | ||
$x0: $x1; | ||
} | ||
|
||
@return $x1; | ||
} | ||
|
||
@function strip-units($number) { | ||
@return $number / ($number * 0 + 1); | ||
} | ||
|
||
@function square($number) { | ||
$unitless: strip-units($number); | ||
@return ($unitless * $unitless); | ||
} | ||
|
||
@function get-hypotenuse($ab, $ac) { | ||
@if unit($ab) == unit($ac) { | ||
@return square-root(square($ab) + square($ac)) + unquote(unit($ab)); | ||
} @else { | ||
@error 'The two value into the get-hypotenuse() function must share the same unit type'; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
@import './get-hypotenuse'; | ||
|
||
@function ribbons-band--width($gutter, $flags) { | ||
@return ( | ||
('width', get-hypotenuse($gutter, $gutter), $flags), | ||
); | ||
} | ||
|
||
|
||
// (1) Big static value in order to make sure that for any gutter value the | ||
// before and after goes off the thumbnail element | ||
// (2) We set a negative margin on x axis in order to avoid a very thin band | ||
// where the `::after` and `::before` pseudo elements are not perfectly | ||
// sticked to the `.thumbnail__ribbon`. | ||
|
||
@function ribbons-band-pseudos--commons($nothing, $flags) { | ||
@return ( | ||
('content', ''), | ||
('display', block), | ||
('position', absolute), | ||
('top', 0), | ||
('height', 100%), | ||
('width', 10000px), // (1) | ||
('margin', 0 -1px), // (2) | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
@function ribbons--position($orientation, $flags) { | ||
$property-affected: if($orientation == 'right', 'left', 'right'); | ||
|
||
@if $orientation == 'right' or $orientation == 'left' { | ||
$rotate-direction: if($orientation == 'left', -1, 1); | ||
|
||
@return ( | ||
($property-affected, 100%, $flags), | ||
($orientation, auto, $flags), | ||
('margin-#{$property-affected}', value($ribbons--gutter, $flags) * -1, $flags), | ||
('margin-#{$orientation}', 0, $flags), | ||
('transform-origin', top #{$property-affected}, $flags), | ||
('transform', rotate(45deg * $rotate-direction), $flags), | ||
); | ||
} @else { | ||
@error "The parameter `$orientation` must be a string value that can only be 'right' or 'left'"; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,25 @@ | ||
$ribbons--font-size: 1rem !default; | ||
$ribbons--font-size: trwl-theme-size('md') !default; | ||
$ribbons--font-family: null !default; | ||
$ribbons--font-weight: null !default; | ||
$ribbons--text-transform: null !default; | ||
$ribbons--letter-spacing: null !default; | ||
$ribbons--line-height: null !default; | ||
$ribbons--text-align: null !default; | ||
$ribbons--text-decoration: null !default; | ||
$ribbons--margin: null !default; | ||
$ribbons--border-width: null !default; | ||
$ribbons--border-style: null !default; | ||
$ribbons--border-color: null !default; | ||
$ribbons--border-radius: null !default; | ||
$ribbons--color: null !default; | ||
$ribbons--color: rgb(255, 255, 255) !default; | ||
$ribbons--box-shadow: null !default; | ||
$ribbons--background: null !default; | ||
$ribbons--background-color: null !default; | ||
$ribbons--background-color: ( | ||
'default': trwl-theme-color('gray-darker'), | ||
'-primary': trwl-theme-color('primary'), | ||
'-success': trwl-theme-color('success'), | ||
'-warning': trwl-theme-color('warning'), | ||
'-danger': trwl-theme-color('danger'), | ||
) !default; | ||
$ribbons--size: 7.5em !default; | ||
$ribbons--position: ( | ||
'default': 'left', | ||
'-right': 'right', | ||
) !default; // 'left' or 'right' | ||
$ribbons--gutter: 3.75em !default; | ||
$ribbons--height: 1.875em !default; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters