-
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
remove bourbon #1883
Conversation
add position-all(absolute, 0) mixin for shorthand of setting all four positions to the same value.
oops missed onePreview: documentation |
strip-unit()Preview: documentation |
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.
Cool cool. How does this affect the bundle size?
// Removes the unit from a Sass numeric value (if present). | ||
// strip-unit(12px) => 12 | ||
@function strip-unit($number) { | ||
@if type-of($number) == "number" and not unitless($number) { |
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.
Just verifying: are these built-in SCSS helpers?
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.
indeed they are
@@ -1,7 +1,7 @@ | |||
// Copyright 2015 Palantir Technologies, Inc. All rights reserved. | |||
// Licensed under the terms of the LICENSE file distributed with this project. | |||
|
|||
@import "~bourbon/app/assets/stylesheets/bourbon"; | |||
|
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.
Probably don't need two newlines in a row here.
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.
ah snap one slipped through!
p.s. @giladgray you have a merge conflict with |
@cmslewis this won't affect bundle size at all because Bourbon only exists at compile time: it's a bunch of mixins and functions, used to generate CSS. |
remove extra linePreview: documentation |
border-radius: $pt-border-radius; | ||
height: $pt-button-height; | ||
padding: 0 ($input-padding-horizontal * 3) 0 $input-padding-horizontal; | ||
-moz-appearance: none; |
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.
// strip-unit(12px) => 12 | ||
@function strip-unit($number) { | ||
@if type-of($number) == "number" and not unitless($number) { | ||
@return $number / ($number * 0 + 1); |
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.
$number / 1
?
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.
12px / 1 == 12px
. but 12px / (0px + 1) == 12
unit math, my friend!
@@ -119,8 +119,8 @@ label.docs-color-scheme-label { margin: ($pt-grid-size * 2) 0; } | |||
} | |||
|
|||
&::before { | |||
@include position(absolute, -2px); | |||
border-radius: 4px; | |||
@include position-all(absolute, -$palette-border-radius / 2); |
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.
👌
cite sourcePreview: documentation |
// 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 |
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.
why the triple slashes?
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.
I dunno, copy-pasted from bourbon source. I think they use it for doc comments? I'll revert to doubles
double slashesPreview: documentation | table |
Fixes #875
Changes proposed in this pull request:
🔥 remove
bourbon
dependencycore
(and devDep from all other packages)we used three things from bourbon:
@mixin font-face()
for icons: added our ownfont-face
mixin based on original Bourbon source@mixin position()
was used heavily as shorthand for position properties. I added@mixin position-all(absolute, 0)
for the simple set-all-sides-to-the-same-value case, and expanded all other usages to the individual CSS properties.@mixin prefixer()
was used forappearance
prop in a few places; replaced with actual CSS properties.