<div class="c-modal c-modal--orientation u-fixed u-top u-left o-bg-primary u-justify-center u-items-center u-p-base u-z-sky">
    <div class="u-flex u-justify-center u-items-center u-column">

        <svg class="c-brand 
  c-brand--resize-medium 
  c-brand--inverse 
   
  " viewBox="0 0 233 50" xmlns="http://www.w3.org/2000/svg">

            <path d="M0 50V0h105.4v50H0Z" fill="#fff" />
            <path d="M58.5 27.3h-3.9v9.3h4.1c2.8 0 4.1-1.7 4.1-4.6 0-3-1.7-4.7-4.3-4.7ZM85.5 13.2c-4 0-6 3-6 11.7 0 8.8 2 12 6 12s6.1-3 6.1-12c0-8.9-2-11.7-6-11.7ZM61.7 17.3c0-2.5-1.3-4-3.7-4h-3.4v8h3.5c2 0 3.6-1.4 3.6-4Z" fill="#E31D57" />
            <path d="M0 0v50h105.4V0H0Zm19.8 36.8c3.2 0 4.5-2.1 5.4-5.3l6.7 1.9c-1.6 6.2-4.7 10.4-12.2 10.4-8.2 0-13.5-5.2-13.5-19S11.3 6.2 19.7 6.2c6.5 0 11 3 12.3 11.1l-6.7 1.8c-.5-2.5-1.5-6-5.4-6-4.3 0-6 3.6-6 11.5 0 9.1 2 12.2 5.9 12.2ZM42.7 43h-7.4V7h7.4V43ZM59 43H47.4V7h11.2c6.3 0 10 3.5 10 9.5 0 4.4-2.7 7-5 7.4v.2c3 .7 6.5 3 6.5 8.9 0 6.5-3.3 10.1-11 10.1Zm26.5.8c-8.5 0-13.6-5.4-13.6-19 0-13.4 5.1-18.6 13.6-18.6 8.6 0 13.7 5 13.7 18.7 0 13.6-5.1 18.9-13.7 18.9Z" fill="#E31D57" />
            <path fill-rule="evenodd" clip-rule="evenodd" d="M144.7 6.3c8.3 0 13.3 5 13.3 18.8s-5 18.7-13.3 18.7-13.1-5-13.1-18.8c0-14 4.9-18.7 13.1-18.7Zm70.8.6 3.4 10 1.3 4.3h.2l1.4-4.3 3.4-10h7.7l-9 23.3v13h-7.6v-13L207.1 7h8.4Zm-82.1 0v2.5a12.9 12.9 0 0 0-2.9 4.7h-4.4v29h-7.5v-29h-7.3V7h22.1Zm38.8 0c9.2 0 13.3 6.9 13.3 18.3s-3.8 18-13 18H161V6.8h11.2Zm31.3 0 7.6 36.2h-7.9l-1-6.3H194l-1 6.3h-7.7L193 7h10.6Zm-58.7 6.6c-3.8 0-5.6 2.7-5.6 11.4 0 8.8 1.8 11.7 5.6 11.7 3.7 0 5.5-2.6 5.5-11.5 0-8.8-1.9-11.6-5.5-11.6Zm26.7.6h-3V36h3c4.1 0 6.4-2.7 6.4-10.5 0-8.7-2.3-11.3-6.4-11.3Zm26.7 0h-.3l-1 6.6-1.7 9.1h5.7l-1.6-9-1.1-6.7Z" class="c-brand__network" />

        </svg>

        <h2 class="u-label-01 u-color-inverse u-text-center u-my-medium">Ruota il tuo telefono per tornare a leggere</h2>
        <svg class="o-icon o-icon--fill o-icon--inverse">
            <use xlink:href="#icon-rotate-mobile"></use>
        </svg>
    </div>
</div>
<div class="c-modal c-modal--orientation u-fixed u-top u-left o-bg-primary u-justify-center u-items-center u-p-base u-z-sky">
  <div class="u-flex u-justify-center u-items-center u-column">
    {% render "@brand--default",{inverse:true},true %}
    <h2 class="u-label-01 u-color-inverse u-text-center u-my-medium">Ruota il tuo telefono per tornare a leggere</h2>
    <svg class="o-icon o-icon--fill o-icon--inverse"><use xlink:href="#icon-rotate-mobile"></use></svg>
  </div>
</div>
{
  "action": false,
  "media": "https://unsplash.it/1200/800?random",
  "title": "Lorem ipsum",
  "description": "Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam, quas.",
  "action_one": "Chiudi",
  "action_two": "Richiedi info"
}
  • Content:
    // Name:            Modal
    // Description:     Modal of website
    //
    // Component:       `c-modal`
    //
    // Dependencies:    `settings/v7/colors.tokens`
    //                  `settings/v7/colors.themes`
    //                  `settings/v7/colors.mode`
    //                  `settings/v7/global`
    //                  `settings/v7/spacing.tokens`
    //
    // ========================================================================
    @use '../../../assets/sass/settings/v7/colors.tokens' as *;
    @use '../../../assets/sass/settings/v7/layout-standard' as *;
    @use '../../../assets/sass/settings/v7/global' as *;
    @use '../../../assets/sass/settings/v7/spacing.tokens' as *;
    @use '../../../assets/sass/tools/v7/mq' as *;
    @use '../../../assets/sass/tools/v7/zindex' as *;
    @use '../../../assets/sass/tools/v7/typography' as *;
    
    $modal-close-position: -12px;
    
    .c-modal {
      --modal-size: 90%;
    
      &__dialog {
        opacity: 0;
        visibility: hidden;
        background: rgba($ui-02, .5);
        transition: opacity .25s ease;
        @include z(clouds);
      }
    
      &__close {
        top: 1rem;
        right: 1rem;
        fill: $ui-02;
        @include z(high);
      }
    
      &__wrap {
        top: -50%;
        transition: top .5s ease-in-out;
      }
    
      input {
        &:checked {
          ~ .c-modal__dialog {
            opacity: 1;
            visibility: visible;
            .c-modal__wrap {
              top: 0;
            }
          }
        }
      }
    
      &__media {
        max-width: var(--modal-size);
        margin: 0 auto;
        @include bp(md) {
          --modal-size: 70%;
        }
        &__close {
          top: $modal-close-position;
          right: $modal-close-position;
          border: 2px solid $ui-01;
          background: $ui-02;
          @include z(high);
        }
      }
    
      &__content {
        background: $ui-01;
        border-radius: 2px;
      }
    
      &__footer {
        // background: $ui-01;
        border-radius: 2px;
        :first-child {
          margin-right: auto;
        }
      }
    
      &__textual {
        max-width: var(--modal-size);
        margin: 0 auto;
        max-height: 80vh;
        @include bp(md) {
          --modal-size: 50%;
        }
      }
    
      &__image {
        max-height: 90svh;
      }  
    
      &--orientation {
        display: none;
        height: 100vh;
    
        height: 100vh;
        width: 100vw;
        @include z(cover);
    
        @media (max-width: 768px) and (orientation: landscape) {
          display: flex;
        }
    
        .o-icon {
          animation: rotate 3s infinite ease-in-out;
        }
      }
      
    }
    
    .c-modal--popover {
      top: 0;
      @supports not selector(:popover-open) {
        /* Questo blocco di codice verrà applicato se il browser NON supporta 'popover' */   
        display: none;
      }
      @include bp(sm){
        height: fit-content;
      }
      &::backdrop{
        backdrop-filter: blur(5px);
        background-color: rgba($ui-02, .8);
        transition: display var(--_duration) var(--ease-4);
        touch-action: none;
      }  
      &__body {
        height: calc(100% - 2*$padding-small);
        @include bp(sm){
          height: auto;
        }
      }
      &__btn {
        @supports not selector(:popover-open) {
          /* Questo blocco di codice verrà applicato se il browser NON supporta 'popover' */   
          display: none;
        }
      }
    }
    
    
  • URL: /components/raw/modal/_modal.scss
  • Filesystem Path: src/lib/components/modal/_modal.scss
  • Size: 3 KB

Modal

This component serves to show a modal of websites

Variations

Possible variations:

  • Default - a default modal
  • Media - shows a modal of a media
  • Global - shows a checkbox checkable for a Privacy Police
  • Orientation - a modal that appears in landscape mode

Usage

Render modal

In order to display a modal component use following syntax:

  1. for a default modal :
  {% render "@modal--default" %}
  1. for a media modal:
  {% render "@modal--media" %}
  1. for a global modal :
  {% render "@modal--global" %}
  1. for a orientation modal:
  {% render "@modal--orientation" %}