-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Feat/implement improved graceful degradation ripple #282
Merged
traviskaufman
merged 6 commits into
master
from
feat/implement-improved-graceful-degradation-ripple
Feb 22, 2017
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b2bda13
feat(ripple): Implement improved graceful degradation for ripple
5017490
feat(ripple): Implement improved graceful degradation for ripple
c3389fd
feat(ripple): Implement improved graceful degradation for ripple
128e516
feat(ripple): Implement improved graceful degradation for ripple
d51022b
feat(ripple): Implement improved graceful degradation for ripple
bc73a22
feat(ripple): Implement improved graceful degradation for ripple
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,14 @@ | |
border-radius: 50%; | ||
} | ||
|
||
.mdc-ripple-surface[data-mdc-ripple-is-unbounded][data-demo-no-js]::before, | ||
.mdc-ripple-surface[data-mdc-ripple-is-unbounded][data-demo-no-js]::after { | ||
height: 100%; | ||
left: 0; | ||
top: 0; | ||
width: 100%; | ||
} | ||
|
||
button.demo-surface { | ||
display: inline-block; /* Safari does not center button text otherwise :( */ | ||
background: none; | ||
|
@@ -57,7 +65,14 @@ | |
} | ||
|
||
section { | ||
margin: 48px; | ||
align-items: center; | ||
display: flex; | ||
margin-left: 10px; | ||
} | ||
|
||
section > div { | ||
margin: 48px 0; | ||
width: 400px; | ||
} | ||
|
||
body { | ||
|
@@ -82,6 +97,13 @@ | |
user-select: none; | ||
-webkit-user-select: none; | ||
} | ||
|
||
@media (max-width: 565px) { | ||
section { | ||
flex-direction: column; | ||
width: 100%; | ||
} | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
|
@@ -92,40 +114,80 @@ | |
<main> | ||
<h1>MDC Ripple</h1> | ||
<section> | ||
<h2>Bounded</h2> | ||
<div class="mdc-ripple-surface demo-surface mdc-elevation--z2" tabindex="0"> | ||
Interact with me! | ||
<div> | ||
<h2>Bounded</h2> | ||
<div class="mdc-ripple-surface demo-surface mdc-elevation--z2" tabindex="0"> | ||
Interact with me! | ||
</div> | ||
</div> | ||
<div> | ||
<h2>Bounded - CSS Only</h2> | ||
<div class="mdc-ripple-surface demo-surface mdc-elevation--z2" data-demo-no-js tabindex="0"> | ||
Interact with me! | ||
</div> | ||
</div> | ||
</section> | ||
<section> | ||
<h2>Unbounded</h2> | ||
<div class="mdc-ripple-surface demo-surface material-icons" data-mdc-ripple-is-unbounded | ||
aria-label="Favorite" tabindex="0"> | ||
favorite | ||
<div> | ||
<h2>Unbounded</h2> | ||
<div class="mdc-ripple-surface demo-surface material-icons" data-mdc-ripple-is-unbounded | ||
aria-label="Favorite" tabindex="0"> | ||
favorite | ||
</div> | ||
</div> | ||
<div> | ||
<h2>Unbounded - CSS Only</h2> | ||
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. The fallback ripple seems larger than the JS-enabled one. Is this intentional? |
||
<div class="mdc-ripple-surface demo-surface material-icons" data-mdc-ripple-is-unbounded | ||
aria-label="Favorite" data-demo-no-js tabindex="0"> | ||
favorite | ||
</div> | ||
</div> | ||
</section> | ||
<section> | ||
<h2>Theme Styles</h2> | ||
<div | ||
class="mdc-ripple-surface mdc-ripple-surface--primary | ||
mdc-theme--primary demo-surface mdc-elevation--z2" tabindex="0"> | ||
Primary | ||
<div> | ||
<h2>Theme Styles</h2> | ||
<div | ||
class="mdc-ripple-surface mdc-ripple-surface--primary | ||
mdc-theme--primary demo-surface mdc-elevation--z2" tabindex="0"> | ||
Primary | ||
</div> | ||
<div | ||
class="mdc-ripple-surface mdc-ripple-surface--accent | ||
mdc-theme--accent demo-surface mdc-elevation--z2" tabindex="0"> | ||
Accent | ||
</div> | ||
</div> | ||
<div | ||
class="mdc-ripple-surface mdc-ripple-surface--accent | ||
mdc-theme--accent demo-surface mdc-elevation--z2" tabindex="0"> | ||
Accent | ||
<div> | ||
<h2>Theme Styles - CSS Only</h2> | ||
<div | ||
class="mdc-ripple-surface mdc-ripple-surface--primary | ||
mdc-theme--primary demo-surface mdc-elevation--z2" data-demo-no-js tabindex="0"> | ||
Primary | ||
</div> | ||
<div | ||
class="mdc-ripple-surface mdc-ripple-surface--accent | ||
mdc-theme--accent demo-surface mdc-elevation--z2" data-demo-no-js tabindex="0"> | ||
Accent | ||
</div> | ||
</div> | ||
|
||
</section> | ||
<section> | ||
<h2>Applied to <code><button> element</h2> | ||
<div> | ||
<h2>Applied to <code><button> element</h2> | ||
<button type="button" class="mdc-ripple-surface mdc-elevation--z2 demo-surface">button</button> | ||
</div> | ||
<div> | ||
<h2>Applied to <code><button> element - CSS Only</h2> | ||
<button type="button" class="mdc-ripple-surface mdc-elevation--z2 demo-surface" data-demo-no-js>button</button> | ||
</div> | ||
|
||
</section> | ||
</main> | ||
<script src="assets/material-components-web.js" charset="utf-8"></script> | ||
<script> | ||
(function(global) { | ||
[].forEach.call(document.querySelectorAll('.mdc-ripple-surface'), function(surface) { | ||
[].forEach.call(document.querySelectorAll('.mdc-ripple-surface:not([data-demo-no-js]'), function(surface) { | ||
mdc.ripple.MDCRipple.attachTo(surface); | ||
}); | ||
})(this); | ||
|
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.
should we add a media query here that sets it to
100%
width if the viewport is smaller than400px
? I'm thinking of how this would appear on v. small screensThere 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.
SGTM
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.
Or just
max-width: 400px;
so on small screens it just gets smaller as-needed. But doesn't grow above that.