Skip to content

Instantly share code, notes, and snippets.

@marlenesco
Last active January 23, 2018 14:25
Show Gist options
  • Save marlenesco/2298c9066d8e29b04599d59c2c1baec2 to your computer and use it in GitHub Desktop.
Save marlenesco/2298c9066d8e29b04599d59c2c1baec2 to your computer and use it in GitHub Desktop.
Bootstrap text stripe
.text-stripe {
position: relative;
&:before {
position: absolute;
content: "";
left: -0.1em;
top: 50%;
right: -0.1em;
border-top: .09em solid;
border-color: inherit;
-webkit-transform:rotate(-8deg);
-moz-transform:rotate(-8deg);
-ms-transform:rotate(-8deg);
-o-transform:rotate(-8deg);
transform:rotate(-8deg);
}
&.stripe-reverse:before {
-webkit-transform:rotate(8deg);
-moz-transform:rotate(8deg);
-ms-transform:rotate(8deg);
-o-transform:rotate(8deg);
transform:rotate(8deg);
}
&.stripe-danger:before {
border-color: @brand-danger;
}
&.stripe-success:before {
border-color: @brand-success;
}
&.stripe-info:before {
border-color: @brand-info;
}
&.stripe-primary:before {
border-color: @brand-primary;
}
&.stripe-warning:before {
border-color: @brand-warning;
}
}
@marlenesco
Copy link
Author

marlenesco commented Jan 23, 2018

Usage

<p class="lead">This is an example of a <span class="text-stripe">striped text</span> in a paragraph.</p>
<p class="lead">Another example of a <span class="text-stripe stripe-danger">striped text</span> in a paragraph.</p>
<p class="lead">Another one <span class="text-stripe stripe-reverse stripe-info">striped text</span> in a paragraph.</p>
<p class="lead">And last one <span class="text-stripe text-info stripe-success">striped text</span> in a paragraph.</p>

That's all folks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment