Skip to content

Styling Guide

Murhaf Sousli edited this page Dec 25, 2022 · 6 revisions

Styling using CSS variables

Here are a list of the CSS variables you can use to change main styles:

--sb-margin
--sb-min-width
--sb-height
--sb-color
--sb-background
--sb-font-size
--sb-icon-size
--sb-padding
--sb-text-padding
--sb-border
--sb-border-radius
--sb-line-height
--sb-text-shadow
--sb-font-weight
--sb-overflow

If you still need to change other CSS rules, see the classes in the next section.

Create custom theme

There are several classes that help you to create your custom styles

.sb-moon-theme {
  // share button wrapper
  .sb-wrapper {
    // Content wrapper
    .sb-content {
      // Icon wrapper
      .sb-icon {
      }
      // Text wrapper
      .sb-text {
      }
    }

    // For conditional styles
    // E.g. Apply when icon, text are shown
    &.sb-show-icon.sb-show-text {
       // Icon wrapper
      .sb-icon {
      }
      // Text wrapper
      .sb-text {
      }
    }
  }
}

If you use .sb-moon-theme then the theme name will become moon:

<share-buttons theme="moon"></share-buttons>