Last active
April 4, 2019 18:04
-
-
Save rotcl/ef178a94bfe1f929c90914d779a93d67 to your computer and use it in GitHub Desktop.
Shopify - Banner Jumbo con texto y botones centrado
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
.mx-auto { | |
width: 100%; | |
@include respond-to('large'){ | |
max-width: 960px; | |
left: 0; | |
right: 0; | |
margin: 0 auto; | |
} | |
@include respond-to('xlarge'){ | |
max-width: 1200px; | |
} | |
@include respond-to('medium'){ | |
width: 100%; | |
} | |
@include respond-to('small'){ | |
margin: 5% 0; | |
font-size: 3vw; | |
position: static; | |
transform: none; | |
width: 100%; | |
} | |
a { | |
pointer-events: all; | |
} | |
&.position--center { | |
left: 0; | |
right: 0; | |
margin: 0 auto; | |
text-align: center; | |
@include respond-to('medium'){ | |
width: 85%; | |
} | |
@include respond-to('small'){ | |
width: 100%; | |
padding: 0 5%; | |
margin: 5% 0; | |
} | |
} | |
&.position--left { | |
left: 0; | |
text-align: left; | |
padding: 0 2%; | |
} | |
&.position--right { | |
right: 0; | |
text-align: right; | |
padding: 0 2%; | |
} | |
.pretext { | |
color: {{ settings.banner_color }}; | |
font-family: {{ settings.slideshow_subtitle__font.family }}, {{ settings.slideshow_subtitle__font.fallback_families }}; | |
font-weight: {{ settings.slideshow_subtitle__font.weight }}; | |
text-transform: {{settings.slideshow_subtitle_font_style}}; | |
font-size: {{settings.slideshow_subtitle_size}}px; | |
letter-spacing: {{settings.slideshow_subtitle_letter_spacing}}px; | |
margin-bottom: 10px; | |
{% if settings.slideshow_shadow != blank %} | |
text-shadow: 1px 1px 3px rgba(0,0,0,0.3); | |
{% endif %} | |
@include respond-to('small'){ | |
font-size: 1.4em; | |
color: {{ settings.regular_color }}; | |
text-shadow: none; | |
} | |
@include respond-to('medium'){ | |
font-size: {{settings.slideshow_subtitle_size | divided_by: 1.5 }}px; | |
} | |
@include respond-to('large'){ | |
font-size: {{settings.slideshow_subtitle_size | divided_by: 1.2 }}px; | |
} | |
@include respond-to('larger'){ | |
font-size: {{settings.slideshow_subtitle_size}}px; | |
} | |
} | |
.headline { | |
color: {{ settings.banner_color }}; | |
font-family: {{ settings.slideshow_headline__font.family }}, {{ settings.slideshow_headline__font.fallback_families }}; | |
font-weight: {{ settings.slideshow_headline__font.weight }}; | |
text-transform: {{ settings.slideshow_headline_font_style }}; | |
font-size: {{ settings.slideshow_headline_size }}px; | |
letter-spacing: {{ settings.slideshow_headline_letter_spacing }}px; | |
line-height: 1.4em; | |
margin-bottom: 15px; | |
{% if settings.slideshow_headline_shadow != blank %} | |
text-shadow: 1px 1px 3px rgba(0,0,0,0.3); | |
{% endif %} | |
@include respond-to('small'){ | |
font-size: 2.6em; | |
color: {{ settings.regular_color }}; | |
text-shadow: none; | |
} | |
@include respond-to('medium'){ | |
font-size: {{settings.slideshow_headline_size | divided_by: 1.5 }}px; | |
} | |
@include respond-to('large'){ | |
font-size: {{settings.slideshow_headline_size | divided_by: 1.2 }}px; | |
} | |
@include respond-to('larger'){ | |
font-size: {{settings.slideshow_headline_size}}px; | |
} | |
} | |
.subtitle { | |
color: {{ settings.banner_color }}; | |
font-family: {{ settings.slideshow_subtitle__font.family }}, {{ settings.slideshow_subtitle__font.fallback_families }}; | |
font-weight: {{ settings.slideshow_subtitle__font.weight }}; | |
text-transform: {{settings.slideshow_subtitle_font_style}}; | |
font-size: {{settings.slideshow_subtitle_size}}px; | |
letter-spacing: {{settings.slideshow_subtitle_letter_spacing}}px; | |
position: relative; | |
{% if settings.slideshow_shadow != blank %} | |
text-shadow: 1px 1px 3px rgba(0,0,0,0.3); | |
{% endif %} | |
@include respond-to('small'){ | |
font-size: 1.4em; | |
color: {{ settings.regular_color }}; | |
text-shadow: none; | |
} | |
@include respond-to('medium'){ | |
font-size: {{settings.slideshow_subtitle_size | divided_by: 1.5 }}px; | |
} | |
@include respond-to('large'){ | |
font-size: {{settings.slideshow_subtitle_size | divided_by: 1.2 }}px; | |
} | |
@include respond-to('larger'){ | |
font-size: {{settings.slideshow_subtitle_size}}px; | |
} | |
} | |
.pretext:empty, | |
.headline:empty, | |
.subtitle:empty { | |
display: none; | |
&:before { | |
height: 0; | |
} | |
} | |
} | |
.subtitle p a { | |
pointer-events: all; | |
} | |
.site-heading { | |
display: inline-block; | |
float: none; | |
max-width: 60%; | |
// font-size:0 eliminates offset buttons when they are stacked (inline-block ghost space) | |
font-size: 0; | |
@include respond-to('medium'){ | |
max-width: 80%; | |
} | |
@include respond-to('small'){ | |
width: 100%; | |
max-width: 100%; | |
} | |
.action_button { | |
margin: 10px; | |
@include respond-to('medium'){ | |
// tightens up stacked buttons on iPad | |
margin: 5px; | |
} | |
@include respond-to('small'){ | |
font-size: 16px; | |
} | |
} | |
&.align--center { | |
text-align: center; | |
@include respond-to('medium'){ | |
max-width: 80%; | |
} | |
@include respond-to('small'){ | |
width: 100%; | |
max-width: 100%; | |
} | |
} | |
&.align--left { | |
text-align: left; | |
&:first-child .action_button { | |
margin-left: 0; | |
} | |
.subtitle:before { | |
margin-left: 0; | |
} | |
} | |
&.align--right { | |
text-align: right; | |
&:last-child .action_button { | |
margin-right: 0; | |
} | |
.subtitle:before { | |
margin-right: 0; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
eCommerce - ⚡️ Shopify ⚡️
Ante la necesidad, hice un banner responsive con texto adentro, está hecho para compatibilizar en Turbo con bootstrap.
Solo agregar jumbo-banner.liquid como section, y agregar dentro del Home / Pág internas.