Skip to content

Instantly share code, notes, and snippets.

@johndhancock
Last active August 18, 2021 18:18
Show Gist options
  • Save johndhancock/e64e53e81424d2246c18cee01178be46 to your computer and use it in GitHub Desktop.
Save johndhancock/e64e53e81424d2246c18cee01178be46 to your computer and use it in GitHub Desktop.
bg-hbs-components
<!-- takes a refer object and outputs a link that has a shade overlay -->
<div class="group__refer">
<a href="{{value.url}}">
<div class="refer-image__container">
{{> base/refer-image image=value.image alt=value.altText}}
</div>
<div class="refer-text">
<h6 class="bentonsanscond-regular">{{value.overline}}</h6>
<h5 class="bentonsanscond-bold">{{value.headline}}</h5>
</div>
</a>
</div>
.group__refer
margin-bottom 2rem
position relative
+mq(bp-2)
margin-bottom 0
img
position relative
width 100%
.refer-image__container
position relative
&:after
content ''
width 100%
height 100%
background-color rgba(0,0,0, 0.8)
z-index 10
display block
position absolute
top 0
left 0
transition all 0.25s ease-out
&:hover
&:after
background-color rgba(0,0,0, 0.4)
.refer-text
color white
position absolute
top 50%
left 50%
text-align center
transform translate(-50%, -50%)
z-index 20
width 80%
pointer-events none
h5, h6
text-shadow 2px 2px 4px rgba(33,33,33,0.45)
h5
font-size 1.5rem
line-height 1.75rem
+mq(bp-2)
font-size 1.25rem
line-height 1.5rem
+mq(bp-3)
font-size 2rem
line-height 2.25rem
letter-spacing 0.25px
h6
font-size 0.75rem
text-transform uppercase
margin-bottom 0.5rem
+mq(bp-3)
font-size 1rem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment