Skip to content

Instantly share code, notes, and snippets.

@togakangaroo
Created February 14, 2018 03:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save togakangaroo/79bf39598a8bac16da99c57fa4edccec to your computer and use it in GitHub Desktop.
Save togakangaroo/79bf39598a8bac16da99c57fa4edccec to your computer and use it in GitHub Desktop.
<style id="jsbin-css">
section {
overflow: hidden;
background-color: teal;
height: calc(5 * 2.6ex);
line-height: 2.6ex;
}
section p {
float: right;
margin: 0;
margin-left: -1px;
width: 100%;
}
section:before {
content: "";
float: left;
outline: 1px solid green;
width: 1px;
height: 100%;
}
section:after {
content: "…";
background: rgba(255, 255, 255, 0.5);
float: right;
position: relative;
text-align: right;
left: 100%;
box-sizing: border-box;
top: -3ex;
width: 3.5ex;
margin-left: calc(1px - 3.5ex);
}
</style>
<section>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Vero omnis magnam deleniti, velit, ratione distinctio. Ex unde adipisci molestiae id aspernatur dolor, totam nulla aperiam in! Animi nulla, id? Laudantium.
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Vero omnis magnam deleniti, velit, ratione distinctio. Ex unde adipisci molestiae id aspernatur dolor, totam nulla aperiam in! Animi nulla, id? Laudantium.
</p>
</section>
<script id="jsbin-source-css" type="text/css">section {
overflow: hidden;
background-color: teal;
height: ~"calc(5 * 2.6ex)";
line-height: 2.6ex;
p {
float: right;
margin: 0;
margin-left: -1px;
width: 100%;
}
&:before {
content: "";
float: left;
outline: 1px solid green;
width: 1px;
height: 100%;
}
&:after {
content: "…";
//background: linear-gradient(to right, rgba(255, 255, 255, 0), white 10%, white);
background: rgba(255,255,255, .5);
float: right;
position: relative;
text-align: right;
left: 100%;
box-sizing: border-box;
top: -3.0ex;
width: 3.5ex;
margin-left: ~"calc(1px - 3.5ex)";
}
}
</script>
section {
overflow: hidden;
background-color: teal;
height: calc(5 * 2.6ex);
line-height: 2.6ex;
}
section p {
float: right;
margin: 0;
margin-left: -1px;
width: 100%;
}
section:before {
content: "";
float: left;
outline: 1px solid green;
width: 1px;
height: 100%;
}
section:after {
content: "…";
background: rgba(255, 255, 255, 0.5);
float: right;
position: relative;
text-align: right;
left: 100%;
box-sizing: border-box;
top: -3ex;
width: 3.5ex;
margin-left: calc(1px - 3.5ex);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment