<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"
}
  • Content:
    .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;
            }
        }
    }
    
  • URL: /components/raw/caption-hero/_caption-hero.scss
  • Filesystem Path: components/Atoms/caption-hero/_caption-hero.scss
  • Size: 1.2 KB
  • Content:
    $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
    
  • URL: /components/raw/caption-hero/caption-hero.settings.scss
  • Filesystem Path: components/Atoms/caption-hero/caption-hero.settings.scss
  • Size: 512 Bytes
  • Content:
    {
        "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": {}
    }
  • URL: /components/raw/caption-hero/composer.json
  • Filesystem Path: components/Atoms/caption-hero/composer.json
  • Size: 289 Bytes

Caption hero

Implementeringsråd

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.

Versionhistorik

3.1.0 - Nya positioneringar

  • Systemet för att positionera stödjer nu även centrering.

3.0.1 - Använder fler globala variabler i settings.

3.0.0 - Brytande ändringar

  • Positioneringsklasserna från core/_position.scss har bytt namn

2.0.0 - Brytande ändringar

  • Använder nya utilityklasser från core/_position.scss
  • Visar nu varianter (“rounded” och “secondary”)

1.0.0 - Flyttat komponenten till git-repo.

2019-08-21 (0.0.0)

  • Använt position: relative för små skärm (SM mode) och position: absolute för andra skärmstorlekar.
    • “Caption” hamnas under herobilden i mobil läge.
    • “Caption” hamnas över herobilden i andra större skärmstorlekar.
  • Använt 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).