<div class="rh-caption-hero rh-dp-sm rh-caption-hero--rounded">
Ännu smultron rännil händer, dimmhöljd äng vid sista händer.
</div>
<div class="rh-caption-hero rh-dp-from-md rh-center-xy rh-caption-hero--rounded">
Ännu smultron rännil händer, dimmhöljd äng vid sista händer.
</div>
<div class="rh-caption-hero{{#if modifier}} rh-caption-hero--{{modifier}}{{/if}} rh-dp-sm{{#if rounded}} rh-caption-hero--rounded{{/if}}{{#if extendClass}} {{extendClass}}{{/if}}">
{{text}}
</div>
<div class="rh-caption-hero{{#if modifier}} rh-caption-hero--{{modifier}}{{/if}} rh-dp-from-md{{#if centered}} {{centered}}{{/if}}{{#if x-align}} {{x-align}}{{/if}}{{#if y-align}} {{y-align}}{{/if}}{{#if rounded}} rh-caption-hero--rounded{{/if}}{{#if extendClass}} {{extendClass}}{{/if}}">
{{text}}
</div>
{
"text": "Ännu smultron rännil händer, dimmhöljd äng vid sista händer.",
"extendClass": "",
"x-align": "",
"y-align": "",
"modifier": "",
"rounded": "true",
"centered": "rh-center-xy"
}
.rh-caption-hero {
/* Positionering */
position: relative;
/* Box-modell/beteende */
padding: $caption-hero--padding; //em(15);
/* Visuellt */
background-color: $caption-hero--background-color;
/* Typografi */
color: $caption-hero--color;
@if $caption-hero--font-size {
font-size: $caption-hero--font-size;
}
&--secondary {
/* Visuellt */
background-color: $caption-hero--secondary-background-color;
/* Typografi */
color: $caption-hero--secondary-color;
}
&--rounded {
// border-radius: 0.4ex;
border-radius: $caption-hero--rounded--border-radius--default;
@include medium {
border-radius: $caption-hero--rounded--border-radius--medium;
}
}
@include medium {
/* Positionering */
position: absolute;
/* Box-modell/beteende */
max-width: $caption-hero--medium--max-width;
}
@include large {
/* Positionering */
/* Typografi */
@if $caption-hero--large--font-size {
font-size: $caption-hero--large--font-size;
}
}
}
$caption-hero--padding: $space-5;
$caption-hero--background-color: $black !default;
$caption-hero--color: $white;
$caption-hero--font-size: $h2-medium; //false
// Rounded
$caption-hero--rounded--border-radius--default: 0;
$caption-hero--rounded--border-radius--medium: $space-2;
// Secondary
$caption-hero--secondary-background-color: $white;
$caption-hero--secondary-color: $black;
// Medium
$caption-hero--medium--max-width: 20.385em; //530px;
// Large
$caption-hero--large--font-size: $h2-medium; //false
{
"name": "regionhalland/caption-hero",
"description": "Caption hero",
"type": "styleguide-atom",
"license": "GPL-3.0",
"authors": [
{
"name": "Roland Hydén",
"email": "Roland.Hyden@Regionhalland.se"
}
],
"require": {}
}
Obs! Komponenten kräver klasser för positionering i x- och y-led för att fungera. Dessa finns i “core/_positions.scss”.
Obs! Notera att komponenten läggs ut två gånger som visas vid olika brytpunkter. Detta är nödvändigt eftersom positioneringen görs med utilityklasser och inte modifiers i själva komponenten.
position: relative
för små skärm (SM mode) och position: absolute
för andra skärmstorlekar.extendClass
i konfig filen för att man kan påverka komponentens beteende när det renderas i annan komponent (Exempel: en atom i en molecules).