Share

<div class="c-share u-flex">

    <!-- 
    <a href="#" class="u-mr-xsmall">
      <div class="c-share__item c-share__item--facebook u-flex u-items-center u-justify-center">
        <svg class="o-icon--md o-icon--animate  o-icon--fill-inverse ">
          <use xlink:href="#icon-facebook" xmlns:xlink="http://www.w3.org/1999/xlink"></use>
        </svg>
      </div>
    </a>
  
    <a href="#" class="u-mr-xsmall">
      <div class="c-share__item c-share__item--twitter u-flex u-items-center u-justify-center">
        <svg class="o-icon--md o-icon--animate  o-icon--fill-inverse ">
          <use xlink:href="#icon-twitter" xmlns:xlink="http://www.w3.org/1999/xlink"></use>
        </svg>
      </div>
    </a>
  
    <a href="#" class="u-mr-xsmall">
      <div class="c-share__item c-share__item--whatsapp u-flex u-items-center u-justify-center">
        <svg class="o-icon--md o-icon--animate  o-icon--fill-inverse ">
          <use xlink:href="#icon-whatsapp" xmlns:xlink="http://www.w3.org/1999/xlink"></use>
        </svg>
      </div>
    </a>
   -->

    <button class="c-btn c-btn--default u-relative  u-flex u-cursor-pointer  u-items-center u-nowrap
   
 
  

  
    u-label-04
   

  " role="button">

        Condividi

        <svg aria-hidden="true" class="o-icon  u-ml-xxsmall 
    o-icon--md ">
            <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-share"></use>
        </svg>

    </button>

    <button data-share-native class="c-share__item c-share__item--share u-flex u-items-center u-justify-center u-cursor-pointer u-border-2 u-border-solid u-border-negative">
        <svg class="o-icon--md o-icon o-icon--animated o-icon--currentcolor u-mr-xxxsmall">
            <use xlink:href="#icon-share" xmlns:xlink="http://www.w3.org/1999/xlink"></use>
        </svg>
    </button>
</div>
<div class="c-share u-flex">
  
  <!-- {% for social in share %}
    <a href="#" class="u-mr-xsmall">
      <div class="c-share__item c-share__item--{{social}} u-flex u-items-center u-justify-center">
        <svg class="o-icon--md o-icon--animate {% if social=="share"%} o-icon o-icon--negative {% else %} o-icon--fill-inverse {% endif %}">
          <use xlink:href="#icon-{{social}}" xmlns:xlink="http://www.w3.org/1999/xlink"></use>
        </svg>
      </div>
    </a>
  {% endfor %} -->

  {% render "@button--default", {label: 'Condividi', icon:'share', size: 'medium'}, true %}
  
  <button data-share-native class="c-share__item c-share__item--share u-flex u-items-center u-justify-center u-cursor-pointer u-border-2 u-border-solid u-border-negative">
    <svg class="o-icon--md o-icon o-icon--animated o-icon--currentcolor u-mr-xxxsmall">
      <use xlink:href="#icon-share" xmlns:xlink="http://www.w3.org/1999/xlink"></use>
    </svg>
  </button>
  </div>
{
  "share": [
    "facebook",
    "twitter",
    "whatsapp"
  ]
}
  • Content:
    @use 'sass:color';
    
    // Name:            Social share
    // Description:     Social share widget for items
    //
    // Component:       `c-share`
    //
    // Dependencies:    `settings/v7/colors.tokens`
    //
    // ========================================================================
    @use '../../../assets/sass/objects/v7/links' as *;
    @use '../../../assets/sass/objects/v7/icons' as *;
    
    @use '../../../assets/sass/tools/v7/utils'as *;
    @use '../../../assets/sass/tools/v7/colors'as *;
    @use '../../../assets/sass/tools/v7/mq'as *;
    @use '../../../assets/sass/tools/v7/spacing'as *;
    @use '../../../assets/sass/tools/v7/typography'as *;
    @use '../../../assets/sass/tools/v7/zindex'as *;
    
    @use '../../../assets/sass/settings/v7/layout-standard' as *;
    @use '../../../assets/sass/settings/v7/atomictypography.map' as *;
    @use '../../../assets/sass/settings/v7/colors.tokens' as *;
    @use '../../../assets/sass/settings/v7/colors.map' as *;
    @use '../../../assets/sass/settings/v7/sizes.map' as *;
    @use '../../../assets/sass/settings/v7/spacing.tokens' as *;
    @use '../../../assets/sass/settings/v7/typography.tokens' as *;
    @use '../../../assets/sass/settings/v7/visibility.map' as *;
    @use '../../../assets/sass/settings/v7/global' as *;
    @use '../../../assets/sass/settings/v7/properties' as *;
    @use '../../../assets/sass/settings/v7/scrollbar' as *;
    // Variables
    // ========================================================================
    
    $share-item-rounded: 50%;
    $share-item-size: 2.5rem;
    
    $shares: ( // 
      facebook:  #3b5998,
      twitter: #000,
      whatsapp: #25d366,
      email: $ui-06,
      share: var(--background-color)
    );
    
    // Styles
    // ========================================================================
    
    .c-share {
      .l-entry__byline--small &,
      .l-entry__byline & {
        .c-btn.c-btn--default {
          display: none;
        }
      }
      &__item {
        width: $share-item-size;
        height: $share-item-size;
        border-radius: $share-item-rounded;
        &--share {
          border: none;
          display: flex;
          background-color: var(--background-color);
          
          .l-entry__footer & {
            display: none;
          }
          @include bp(md){
            display: none;
          }
        }
        @each $social, $color in $shares {
          &--#{$social} {
            @if $social != 'share' {
              background-color: $color;
              &:hover {
                background-color: color.adjust($color, $lightness: 5%);
              }
            }
          }
        }
      }
    }
    
  • URL: /components/raw/share/share.scss
  • Filesystem Path: src/lib/components/share/share.scss
  • Size: 2.4 KB

Share

This component shows a social share widget for items

Usage

Render share

In order to display a share component

  {% render "@share" %}