-
Notifications
You must be signed in to change notification settings - Fork 30
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
Solid Popover Component #476
Open
emilybrick
wants to merge
2
commits into
master
Choose a base branch
from
SOLID-430-tooltip-component
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
// | ||
// Popovers | ||
// -------------------------------------------------- | ||
$background-caret-size: .625rem; | ||
$foreground-caret-size: .5625rem; | ||
|
||
.popover-right, .popover-left, .popover-bottom, .popover-top { | ||
width: 100%; | ||
position: relative; | ||
padding: $space-2; | ||
|
||
// shared styles between right, left, bottom, and top caret for the popover | ||
&:before, &:after { | ||
content: " "; | ||
pointer-events: none; | ||
position: absolute; | ||
height: 0; | ||
width: 0; | ||
border: solid transparent; | ||
right: 100%; | ||
} | ||
&:before { //foreground caret styles for right, left, bottom, & top popover | ||
border-color: transparent; | ||
border-width: $background-caret-size; | ||
} | ||
&:after { // background caret styles for right, left, bottom, & top popover | ||
border-color: transparent; | ||
border-width: $foreground-caret-size; | ||
} | ||
} | ||
|
||
.popover-right, .popover-left { | ||
&:before { | ||
margin-top: -($background-caret-size); //foreground caret styles for right & left popover | ||
} | ||
&:after { | ||
margin-top: -($foreground-caret-size); //background caret styles for between right & left popover | ||
} | ||
} | ||
|
||
.popover-right { | ||
&:before, &:after { // caret styles for the right popover | ||
right: 100%; | ||
top: 50%; | ||
} | ||
&:before { | ||
border-right-color: lighten($fill-gray, 20%); | ||
} | ||
&:after { | ||
border-right-color: $fill-white; | ||
} | ||
&--gray { | ||
background-color: darken($fill-gray, 20%); | ||
border: none; | ||
color: white; | ||
&:before { | ||
border-right-color: darken($fill-gray, 20%); | ||
} | ||
&:after { | ||
border-right-color: darken($fill-gray, 20%); | ||
} | ||
} | ||
} | ||
|
||
.popover-left { | ||
&:before, &:after { // caret styles for the left popover | ||
left: 100%; | ||
top: 50%; | ||
} | ||
&:before { | ||
border-left-color: lighten($fill-gray, 20%); | ||
} | ||
&:after { | ||
border-left-color: $fill-white; | ||
} | ||
&--gray { | ||
background-color: darken($fill-gray, 20%); | ||
border: none; | ||
color: white; | ||
&:before { | ||
border-left-color: darken($fill-gray, 20%); | ||
} | ||
&:after { | ||
border-left-color: darken($fill-gray, 20%); | ||
} | ||
} | ||
} | ||
|
||
.popover-top, .popover-bottom { | ||
&:before { | ||
margin-left: -($background-caret-size); // foreground caret styles shared between top and bottom popover | ||
} | ||
&:after { | ||
margin-left: -($foreground-caret-size); // background caret styles shared between top and bottom popover | ||
} | ||
} | ||
|
||
.popover-top { | ||
&:before, &:after { // caret styles for the top popover | ||
left: 50%; | ||
bottom: 100%; | ||
} | ||
&:before { | ||
border-bottom-color: lighten($fill-gray, 20%); | ||
} | ||
&:after { | ||
border-bottom-color: $fill-white; | ||
} | ||
&--gray { | ||
background-color: darken($fill-gray, 20%); | ||
border: none; | ||
color: white; | ||
&:before { | ||
border-bottom-color: darken($fill-gray, 20%); | ||
} | ||
&:after { | ||
border-bottom-color: darken($fill-gray, 20%); | ||
} | ||
} | ||
} | ||
|
||
.popover-bottom { | ||
&:before, &:after { // caret styles for the bottom popover | ||
left: 50%; | ||
top: 100%; | ||
} | ||
&:before { | ||
border-top-color: lighten($fill-gray, 20%); | ||
} | ||
&:after { | ||
border-top-color: $fill-white; | ||
} | ||
&--gray { | ||
background-color: darken($fill-gray, 20%); | ||
border: none; | ||
color: white; | ||
&:before { | ||
border-top-color: darken($fill-gray, 20%); | ||
} | ||
&:after { | ||
border-top-color: darken($fill-gray, 20%); | ||
} | ||
} | ||
} |
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
File renamed without changes.
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,46 @@ | ||
--- | ||
layout: default | ||
title: Popovers | ||
--- | ||
|
||
<section class="xs-mb6"> | ||
|
||
<a name="pagination"></a> | ||
<h2 class="bold xs-mb2">Popovers</h2> | ||
<p class="xs-mb2">Popovers are useful for uncovering helpful information or hints when using a product. Use the <span class="nowrap">.<code class="js-highlight">.popover .popover--right</code></span> classes to incorporate a popover into your project.</p> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it worth mentioning the grey variant here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. gray* |
||
|
||
|
||
<div class="flex xs-flex-column"> | ||
<div class="popover-right card xs-mb3"> | ||
<p>Cassoulet is a rich, slow-cooked casserole originating in the south of France, containing meat, pork skin and white beans. </p> | ||
</div> | ||
<div class="popover-right popover-right--gray card xs-mb3"> | ||
<p>Cassoulet is a rich, slow-cooked casserole originating in the south of France, containing meat, pork skin and white beans. </p> | ||
</div> | ||
<div class="popover-left card xs-mb3"> | ||
<p>Cassoulet is a rich, slow-cooked casserole originating in the south of France, containing meat, pork skin and white beans. </p> | ||
</div> | ||
<div class="popover-left popover-left--gray card xs-mb3"> | ||
<p>Cassoulet is a rich, slow-cooked casserole originating in the south of France, containing meat, pork skin and white beans. </p> | ||
</div> | ||
<div class="popover-top card xs-mb3"> | ||
<p>Cassoulet is a rich, slow-cooked casserole originating in the south of France, containing meat, pork skin and white beans. </p> | ||
</div> | ||
<div class="popover-top popover-top--gray card xs-mb3"> | ||
<p>Cassoulet is a rich, slow-cooked casserole originating in the south of France, containing meat, pork skin and white beans. </p> | ||
</div> | ||
<div class="popover-bottom card xs-mb3"> | ||
<p>Cassoulet is a rich, slow-cooked casserole originating in the south of France, containing meat, pork skin and white beans. </p> | ||
</div> | ||
<div class="popover-bottom popover-bottom--gray card xs-mb3"> | ||
<p>Cassoulet is a rich, slow-cooked casserole originating in the south of France, containing meat, pork skin and white beans. </p> | ||
</div> | ||
</div> | ||
|
||
<div class="xs-mt2"> | ||
{% highlight html %} | ||
|
||
{% endhighlight %} | ||
</div> | ||
|
||
</section> |
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.
✨