-
Notifications
You must be signed in to change notification settings - Fork 857
Eui image focus states #2287
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
Merged
elizabetdev
merged 15 commits into
elastic:master
from
elizabetdev:euiImage-focus-states
Sep 16, 2019
Merged
Eui image focus states #2287
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
c5c1d9f
Improving structure
elizabetdev fafcac0
Adding hover and focus styles
elizabetdev fe7d019
Merge remote-tracking branch 'upstream/master' into euiImage-focus-st…
elizabetdev a45eefe
Updating changelog
elizabetdev 7f4ed16
BEM
elizabetdev 32ee777
Focus and full screen hover styles
elizabetdev 5f3a093
Merge branch 'master' into euiImage-focus-states
elizabetdev 0258da9
Adding a11y improvements
elizabetdev c5fcd3f
Merge branch 'master' into euiImage-focus-states
elizabetdev ac4d833
Reverting to old sctructure without a11y
elizabetdev 09fd6f9
No caption transition
elizabetdev b98b1ce
Merge branch 'master' into euiImage-focus-states
elizabetdev 8e04ebe
Merge branch 'master' into euiImage-focus-states
thompsongl 19fe143
typos
thompsongl e54fc83
Merge branch 'master' into euiImage-focus-states
elizabetdev 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 hidden or 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 hidden or 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,19 +1,41 @@ | ||
| // Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
|
||
| exports[`EuiImage is rendered 1`] = ` | ||
| <figure | ||
| aria-label="aria-label" | ||
| class="euiImage euiImage--large testClass1 testClass2" | ||
| data-test-subj="test subject string" | ||
| > | ||
| <img | ||
| alt="alt" | ||
| class="euiImage__img" | ||
| src="/cat.jpg" | ||
| /> | ||
| </figure> | ||
| `; | ||
|
|
||
| exports[`EuiImage is rendered and allows full screen 1`] = ` | ||
| <button | ||
| class="euiImage euiImage--large euiImage--allowFullScreen testClass1 testClass2" | ||
| type="button" | ||
| > | ||
| <figure | ||
| aria-label="aria-label" | ||
| class="euiImage euiImage--large testClass1 testClass2" | ||
| data-test-subj="test subject string" | ||
| > | ||
| <img | ||
| alt="alt" | ||
| class="euiImage__img" | ||
| src="/cat.jpg" | ||
| /> | ||
| <svg | ||
| class="euiIcon euiIcon--medium euiIcon--ghost euiIcon-isLoading euiImage__icon" | ||
| focusable="false" | ||
| height="16" | ||
| viewBox="0 0 16 16" | ||
| width="16" | ||
| xmlns="http://www.w3.org/2000/svg" | ||
| /> | ||
| </figure> | ||
| </button> | ||
| `; |
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -17,14 +17,40 @@ | |
| } | ||
| } | ||
|
|
||
| &.euiImage--allowFullScreen:hover { | ||
| .euiImage__img { | ||
| cursor: pointer; | ||
| &.euiImage--allowFullScreen { | ||
| &:focus .euiImage__img { | ||
| outline: 2px solid $euiFocusRingColor; | ||
|
Contributor
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. Much better 🎉 |
||
| } | ||
|
|
||
| .euiImage__icon { | ||
| &:hover .euiImage__icon { | ||
| visibility: visible; | ||
| opacity: 1; | ||
| fill-opacity: 1; | ||
elizabetdev marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| &:hover .euiImage__caption, | ||
| &:focus .euiImage__caption { | ||
| text-decoration: underline; | ||
| } | ||
|
|
||
| &:not(.euiImage--hasShadow):hover, | ||
| &:not(.euiImage--hasShadow):focus { | ||
| .euiImage__img { | ||
| @include euiBottomShadowMedium; | ||
| } | ||
| } | ||
|
|
||
| &.euiImage--hasShadow:hover, | ||
| &.euiImage--hasShadow:focus { | ||
| .euiImage__img { | ||
| @include euiBottomShadow; | ||
| } | ||
| } | ||
|
|
||
| .euiImage__img { | ||
| cursor: pointer; | ||
|
|
||
| // transition the shadow | ||
| transition: all $euiAnimSpeedFast $euiAnimSlightResistance; | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -62,31 +88,48 @@ | |
|
|
||
| .euiImage__icon { | ||
| visibility: hidden; | ||
| opacity: 0; | ||
| fill-opacity: 0; | ||
| position: absolute; | ||
| right: $euiSize; | ||
| top: $euiSize; | ||
| transition: opacity $euiAnimSpeedSlow $euiAnimSlightResistance ; | ||
| transition: fill-opacity $euiAnimSpeedSlow $euiAnimSlightResistance; | ||
| cursor: pointer; | ||
| } | ||
|
|
||
| // The FullScreen image that optionally pops up on click. | ||
| .euiImageFullScreen { | ||
| .euiImage-isFullScreen { | ||
| position: relative; | ||
| max-height: 80vh; | ||
| max-width: 80vw; | ||
| animation: euiImageFullScreen $euiAnimSpeedExtraSlow $euiAnimSlightBounce; | ||
|
|
||
| .euiImageFullScreen__img { | ||
| .euiImage-isFullScreen__icon { | ||
| position: absolute; | ||
| right: $euiSize; | ||
| top: $euiSize; | ||
| } | ||
|
|
||
| .euiImage-isFullScreen__img { | ||
| max-height: 80vh; | ||
| max-width: 80vw; | ||
| cursor: pointer; | ||
| transition: all $euiAnimSpeedFast $euiAnimSlightResistance; | ||
| } | ||
|
|
||
| &:hover .euiImageFullScreen__img { | ||
| &:hover .euiImage-isFullScreen__img { | ||
| @include euiBottomShadow; | ||
| cursor: pointer; | ||
| } | ||
| } | ||
|
|
||
| &:focus .euiImage-isFullScreen__img { | ||
| outline: 2px solid $euiFocusRingColor; | ||
| } | ||
|
|
||
| &:hover .euiImage__caption, | ||
| &:focus-within .euiImage__caption { | ||
| text-decoration: underline; | ||
| } | ||
| } | ||
|
|
||
| @keyframes euiImageFullScreen { | ||
| 0% { | ||
|
|
||
This file contains hidden or 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 hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.