Skip to content

Commit 29d0918

Browse files
committed
Merge pull request #14 from dvoytenko/client12
Eliding prototype using text-shadow
2 parents b486108 + 53dd52c commit 29d0918

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

cache/client/amp-access.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,22 @@
2828
(function() {
2929
var style = document.createElement('style');
3030
style.textContent = (
31-
'[amp-access]:not([amp-access-on]) {display: none};' +
31+
'[amp-access]:not([amp-access-on]):not([amp-access-style=elide]) {' +
32+
'display: none' +
33+
'}\n' +
34+
'[amp-access][amp-access-style=elide]:not([amp-access-on]) {' +
35+
'color: transparent !important;' +
36+
'text-shadow: 0 0 1em rgba(0, 0, 0, 0.5) !important;' +
37+
'user-select: none !important;' +
38+
'-webkit-user-select: none !important;' +
39+
'}\n' +
40+
'[amp-access][amp-access-style=elide]:not([amp-access-on]) .-amp-element {' +
41+
'background: rgba(0, 0, 0, 0.05) !important;' +
42+
'border: none !important;' +
43+
'}\n' +
44+
'[amp-access][amp-access-style=elide]:not([amp-access-on]) .-amp-element > .-amp-fill-content {' +
45+
'display: none !important;' +
46+
'}\n' +
3247
'');
3348
document.head.appendChild(style);
3449
})();

pub/archive/article-client.amp.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ <h1 itemprop="headline">Lorem Ipsum</h1>
338338
<a on="tap1:amp-access.login">Login to read more!</a>
339339
</section>
340340

341-
<section amp-access="access = true" amp-access-on class="article-body">
341+
<section amp-access="access = true" amp-access-on amp-access-style=elide class="article-body">
342342
<p>
343343
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
344344
Curabitur ullamcorper turpis vel commodo scelerisque. Phasellus

0 commit comments

Comments
 (0)