-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
remove bourbon #1883
Merged
Merged
remove bourbon #1883
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
ed29105
add font-face mixin modified from bourbon source
a82f8b7
remove bourbon imports and related comments
be75b0e
replace position() usages
f63a92e
replace prefixer appearance usage
90ef45c
clean up font-face mixin
d22a9cc
yarn remove bourbon
d4e7245
oops missed one
67442dd
strip-unit()
c08943a
Merge branch 'master' of github.com:palantir/blueprint into gg/remove…
df5041b
remove extra line
3420890
cite source
bec3de4
double slashes
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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,82 @@ | ||
// Copyright 2017 Palantir Technologies, Inc. All rights reserved. | ||
// Licensed under the terms of the LICENSE file distributed with this project. | ||
|
||
// these implementations borrowed from Bourbon v5, and modified to fit our use cases. | ||
// changes: removed $asset-pipeline argument, added weight/style params like Bourbon v4. | ||
// https://github.com/thoughtbot/bourbon/blob/master/core/bourbon/library/_font-face.scss | ||
// https://github.com/thoughtbot/bourbon/blob/master/core/bourbon/utilities/_font-source-declaration.scss | ||
|
||
// Generates an `@font-face` declaration. You can choose the specific file | ||
// formats you need to output; the mixin supports `eot`, `ttf`, `svg`, `woff2` | ||
// and `woff`. | ||
// | ||
// @argument {string} $font-family | ||
// | ||
// @argument {string} $file-path | ||
// | ||
// @argument {string | list} $file-formats | ||
// List of the font file formats to include. | ||
// | ||
// @argument {string} $weight | ||
// | ||
// @argument {string} $style | ||
// | ||
// @content | ||
// Any additional CSS properties that are included in the `@include` | ||
// directive will be output within the `@font-face` declaration, e.g. you can | ||
// pass in `font-weight`, `font-style` and/or `unicode-range`. | ||
@mixin font-face( | ||
$font-family, | ||
$file-path, | ||
$file-formats, | ||
$font-weight: normal, | ||
$font-style: normal | ||
) { | ||
@font-face { | ||
font-family: $font-family; | ||
font-weight: $font-weight; | ||
font-style: $font-style; | ||
|
||
src: font-source-declaration( | ||
$font-family, | ||
$file-path, | ||
$file-formats | ||
); | ||
|
||
@content; | ||
} | ||
} | ||
|
||
@function font-source-declaration($font-family, $file-path, $file-formats) { | ||
$src: (); | ||
|
||
$formats-map: ( | ||
eot: "#{$file-path}.eot?#iefix" format("embedded-opentype"), | ||
woff2: "#{$file-path}.woff2" format("woff2"), | ||
woff: "#{$file-path}.woff" format("woff"), | ||
ttf: "#{$file-path}.ttf" format("truetype"), | ||
svg: "#{$file-path}.svg##{$font-family}" format("svg"), | ||
); | ||
|
||
@each $key, $values in $formats-map { | ||
@if list-contains($file-formats, $key) { | ||
$file-path: nth($values, 1); | ||
$font-format: nth($values, 2); | ||
|
||
$src: append($src, url($file-path) $font-format, comma); | ||
} | ||
} | ||
|
||
@return $src; | ||
} | ||
|
||
// Returns true if `$list` contains any of `$values`. | ||
@function list-contains($list, $values...) { | ||
@each $value in $values { | ||
@if type-of(index($list, $value)) != "number" { | ||
@return false; | ||
} | ||
} | ||
|
||
@return true; | ||
} |
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
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
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
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
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
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
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooc, none of our tooling does automatic prefixing by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oof actually no, we don't run autoprefixer on the generated CSS file. one of the things we lost in the (gulp) fire, along with comment stripping.