-
Notifications
You must be signed in to change notification settings - Fork 844
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
[Amsterdam] Updating shadows #3428
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3e354d8
Working on shadows.
daveyholler e6701ac
Fixing a missing px unit on small shadows.
daveyholler cf142d8
Fixing a unitless value on large shadows.
daveyholler 71e8d47
Code refactor
a86497f
Removing the largest value from large shadows.
daveyholler bbf5d15
Adding missing semicolons
daveyholler e5fe5e8
Update src/themes/eui-amsterdam/global_styling/mixins/_shadow.scss
daveyholler 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.guide { | ||
background: $euiPageBackgroundColor; | ||
} | ||
|
||
.guidePageContent { | ||
@include euiBottomShadowFlat; | ||
border-left: none; | ||
} |
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 @@ | ||
@import './shadows'; |
10 changes: 10 additions & 0 deletions
10
src/themes/eui-amsterdam/global_styling/functions/_shadows.scss
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,10 @@ | ||
// Use a function to determine shadow opacity based | ||
// on either a light or dark theme. We use a multiplier | ||
// of 1 for light themes and 2.5 for dark themes | ||
@function shadowOpacity($opacity) { | ||
@if (lightness($euiTextColor) < 50) { | ||
@return $opacity * 1; | ||
} @else { | ||
@return $opacity * 2.5; | ||
} | ||
} | ||
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
@import 'button'; | ||
@import 'panel'; | ||
@import 'shadow'; |
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
105 changes: 105 additions & 0 deletions
105
src/themes/eui-amsterdam/global_styling/mixins/_shadow.scss
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,105 @@ | ||
// Opacity variables are included to prevent breaks in downstream | ||
// components. However they need to be removed prior to 8.0 and | ||
// all components that use them must be updated. | ||
|
||
// This file uses RGBA literal values responsibly | ||
// This file uses off-pattern indedentation to be more readible | ||
|
||
// sass-lint:disable no-color-literals, no-color-keywords, indentation, quotes | ||
|
||
@mixin euiSlightShadow($color: $euiShadowColor, $opacity: 0) { | ||
box-shadow: | ||
0 .8px .8px rgba($color, shadowOpacity(.04)), | ||
0 2.3px 2px rgba($color, shadowOpacity(.03)); | ||
} | ||
|
||
@mixin euiBottomShadowSmall($color: $euiShadowColor, $opacity: 0) { | ||
box-shadow: | ||
0 .7px 1.4px rgba($color, shadowOpacity(.07)), | ||
0 1.9px 4px rgba($color, shadowOpacity(.05)), | ||
0 4.5px 10px rgba($color, shadowOpacity(.05)), | ||
0 15px 32px rgba($color, shadowOpacity(.04)); | ||
|
||
@if ($opacity > 0) { | ||
@warn 'The $opacity variable of euiBottomShadowSmall() will be depricated in a future version of EUI.'; | ||
} | ||
} | ||
|
||
@mixin euiBottomShadowMedium($color: $euiShadowColor, $opacity: 0) { | ||
box-shadow: | ||
0 .9px 4px -1px rgba($color, shadowOpacity(.08)), | ||
0 2.6px 8px -1px rgba($color, shadowOpacity(.06)), | ||
0 5.7px 12px -1px rgba($color, shadowOpacity(.05)), | ||
0 15px 15px -1px rgba($color, shadowOpacity(.04)); | ||
|
||
@if ($opacity > 0) { | ||
@warn 'The $opacity variable of euiBottomShadowMedium() will be depricated in a future version of EUI.'; | ||
} | ||
} | ||
|
||
// Similar to shadow medium but wihtout the bottom depth. Useful for popovers | ||
// that drop UP rather than DOWN. | ||
@mixin euiBottomShadowFlat($color: $euiShadowColor, $opacity: 0) { | ||
box-shadow: | ||
0 0 .8px rgba($color, shadowOpacity(.06)), | ||
0 0 2px rgba($color, shadowOpacity(.04)), | ||
0 0 5px rgba($color, shadowOpacity(.04)), | ||
0 0 17px rgba($color, shadowOpacity(.03)); | ||
|
||
@if ($opacity > 0) { | ||
@warn 'The $opacity variable of euiBottomShadowFlat() will be depricated in a future version of EUI.'; | ||
} | ||
} | ||
|
||
// adjustBorder allows the border color to match the drop shadow better so that there's better | ||
// distinction between element bounds and the shadow (crisper borders) | ||
@mixin euiBottomShadow( | ||
$color: $euiShadowColorLarge, | ||
$opacity: 0, | ||
$adjustBorders: false // Deprecated in Amsterdam but left for BWC | ||
) { | ||
box-shadow: | ||
0 1px 5px rgba($color, shadowOpacity(.1)), | ||
0 3.6px 13px rgba($color, shadowOpacity(.07)), | ||
0 8.4px 23px rgba($color, shadowOpacity(.06)), | ||
0 23px 35px rgba($color, shadowOpacity(.05)); | ||
|
||
@if ($opacity > 0) { | ||
@warn 'The $opacity variable of euiBottomShadow() will be depricated in a future version of EUI.'; | ||
} | ||
} | ||
|
||
@mixin euiBottomShadowLarge( | ||
$color: $euiShadowColorLarge, | ||
$opacity: 0, | ||
$adjustBorders: false, // Deprecated in Amsterdam but left for BWC | ||
$reverse: false | ||
) { | ||
@if ($reverse) { | ||
box-shadow: | ||
0 2.7px -9px rgba($color, shadowOpacity(.13)), | ||
0 9.4px -24px rgba($color, shadowOpacity(.09)), | ||
0 21.8px -43px rgba($color, shadowOpacity(.08)); | ||
} @else { | ||
box-shadow: | ||
0 2.7px 9px rgba($color, shadowOpacity(.13)), | ||
0 9.4px 24px rgba($color, shadowOpacity(.09)), | ||
0 21.8px 43px rgba($color, shadowOpacity(.08)); | ||
} | ||
|
||
@if ($opacity > 0) { | ||
@warn 'The $opacity variable of euiBottomShadowLarge() will be depricated in a future version of EUI.'; | ||
} | ||
} | ||
|
||
@mixin euiSlightShadowHover($color: $euiShadowColor, $opacity: 0) { | ||
box-shadow: | ||
0 1px 5px rgba($color, shadowOpacity(.1)), | ||
0 3.6px 13px rgba($color, shadowOpacity(.07)), | ||
0 8.4px 23px rgba($color, shadowOpacity(.06)), | ||
0 23px 35px rgba($color, shadowOpacity(.05)); | ||
|
||
@if ($opacity > 0) { | ||
@warn 'The $opacity variable of euiSlightShadowHover() will be depricated in a future version of EUI.'; | ||
} | ||
} |
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,3 +1,4 @@ | ||
@import 'buttons'; | ||
@import 'borders'; | ||
@import 'typography'; | ||
@import 'shadows'; |
2 changes: 2 additions & 0 deletions
2
src/themes/eui-amsterdam/global_styling/variables/_shadows.scss
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,2 @@ | ||
$euiShadowColor: $euiColorInk; | ||
$euiShadowColorLarge: $euiColorInk; |
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.
💯