Skip to main content

Styling Highlight and Share

This guide explains how to customize the look of Highlight and Share: first using the built-in settings (no code), then using CSS variables and custom CSS for deeper control.


Overriding styles with CSS

Highlight and Share uses CSS custom properties (variables) where possible. You can override them in your theme’s stylesheet, in Appearance → Customize → Additional CSS, or in a child theme.

How it works: The plugin sets variables (e.g. --has-pinterest-button-color). Its own CSS uses those variables. If you redefine the same variable in a more specific selector (e.g. :root or a wrapper), your value wins. That way you don’t have to copy large blocks of CSS—just set the variables you want to change.


CSS variables reference

Inline highlight (selected text)

When users select text and see the yellow highlight (and optional tooltip), these variables control only the tooltip. The highlight background and text colors are set by the plugin from settings; to override them, use the class overrides in the next section.

VariableDefaultWhat it changes
--has-inline-highlight-tooltips-background-color#333Tooltip background.
--has-inline-highlight-tooltips-color#FFFTooltip text color.

Example — different tooltip style:

:root {
--has-inline-highlight-tooltips-background-color: #1a1a2e;
--has-inline-highlight-tooltips-color: #eaeaea;
}

Image (Pin) sharing buttons

These apply to the Pinterest and Web Share buttons on images (content, excerpts, featured images).

VariableDefaultWhat it changes
--has-pinterest-button-color#E7011DPinterest button background.
--has-pinterest-button-color-hover#BE0319Pinterest button hover background.
--has-pinterest-icon-color#FFFFFFPinterest icon color.
--has-pinterest-icon-color-hover#FFFFFFPinterest icon hover.
--has-pinterest-text-color#FFFFFFPinterest label text.
--has-pinterest-text-color-hover#FFFFFFPinterest label hover.
--has-webshare-button-color#f58f2fWeb Share button background.
--has-webshare-button-color-hover#e17713Web Share button hover.
--has-webshare-icon-color#FFFFFFWeb Share icon.
--has-webshare-icon-color-hover#FFFFFFWeb Share icon hover.
--has-webshare-text-color#FFFFFFWeb Share label text.
--has-webshare-text-color-hover#FFFFFFWeb Share label hover.

Example — match your brand:

:root {
--has-pinterest-button-color: #bd081c;
--has-pinterest-button-color-hover: #9a0618;
--has-webshare-button-color: #25d366;
--has-webshare-button-color-hover: #1da851;
}

Headline sharing panel

The small panel that opens when users click the share icon next to a heading.

VariableDefaultWhat it changes
--has-headline-item-row-background#FFFRow background.
--has-headline-item-row-background-hover#efefefRow hover background.
--has-headline-item-row-text-color#1e1e1eRow text color.

Example — dark panel:

:root {
--has-headline-item-row-background: #2d2d2d;
--has-headline-item-row-background-hover: #3d3d3d;
--has-headline-item-row-text-color: #f0f0f0;
}

Click to Share block (CTA)

The Click to Share block outputs variables on the block wrapper. You can override them by targeting the block’s container (e.g. .wp-block-dlxplugins-has-click-to-share or the block’s uniqueId class).

VariableWhat it changes
--has-cta-background-colorBlock background.
--has-cta-background-color-hoverBlock background hover.
--has-cta-quote-text-colorQuote text color.
--has-cta-quote-text-color-hoverQuote text hover.
--has-cta-cta-text-color“Share” / CTA text color.
--has-cta-cta-text-color-hoverCTA text hover.
--has-cta-icon-colorIcon color.
--has-cta-icon-color-hoverIcon hover.
--has-cta-border-colorBorder color.
--has-cta-border-color-hoverBorder hover.
--has-cta-maximum-widthMax width of the block.
--has-cta-inner-paddingInner padding.
--has-cta-outer-marginOuter margin.
--has-cta-border-widthBorder width.
--has-cta-border-radiusBorder radius.
--has-cta-quote-font-familyQuote font.
--has-cta-quote-font-sizeQuote font size.
--has-cta-quote-font-weightQuote font weight.
--has-cta-quote-line-heightQuote line height.
--has-cta-quote-letter-spacingQuote letter spacing.
--has-cta-quote-text-transformQuote text transform.
--has-cta-cta-font-familyCTA font.
--has-cta-cta-font-sizeCTA font size.
--has-cta-cta-font-weightCTA font weight.
--has-cta-cta-line-heightCTA line height.
--has-cta-cta-letter-spacingCTA letter spacing.
--has-cta-cta-text-transformCTA text transform.

Example — override CTA colors for all Click to Share blocks:

.wp-block-dlxplugins-has-click-to-share [class*="highlight-and-share-wrapper"] {
--has-cta-background-color: #f5f5f5;
--has-cta-background-color-hover: #eee;
--has-cta-border-color: #ddd;
--has-cta-quote-text-color: #333;
--has-cta-cta-text-color: #0066cc;
}

Class-based overrides (when variables aren’t enough)

If there’s no variable for what you want to change, you can target the plugin’s classes directly. Use Appearance → Customize → Additional CSS or your theme’s CSS.

Main wrappers and layout

ClassWhere it appearsPurpose
.highlight-and-share-wrapperShare popup, Click to Share blockMain wrapper for share icons.
.orientation-horizontalSameIcons in a row.
.orientation-verticalSameIcons in a column.
.theme-defaultSameDefault theme.
.theme-brand-colorsSameBrand colors (icons only).
.theme-black, .theme-white, etc.SameOther built-in themes.
.hide-has-labelsSameLabels visually hidden (still for screen readers).
.show-has-labelsSameLabels visible.
.has-icon-labelSameIcon + label.
.has-textSameLabel text.
.has-tooltipSameTooltip on hover.

Inline highlight (selected text)

ClassPurpose
.has-inline-textThe highlighted text span (click to share).
.has-inline-text-tooltipThe tooltip above the highlight.

Example — change inline highlight colors without variables:

The plugin injects inline styles for highlight colors from settings. To force your own colors, override with !important or a more specific selector:

.has-inline-text {
background-color: #e8f4fd !important;
color: #0d47a1 !important;
}
.has-inline-text:hover {
background-color: #bbdefb !important;
color: #0d47a1 !important;
}

Image (Pin) sharing

ClassPurpose
.has-pin-image-wrapperWrapper around the image and buttons.
.has-pin-sharing-iconsContainer for Pin / Share buttons.
.has-pin-top-left, .has-pin-top-right, etc.Position of the buttons.
.has-pin-show-on-hoverButtons appear on hover.
.has-pin-svg-pinterestPinterest button.
.has-pin-svg-webshareWeb Share button.
.has-appearance-round, .has-appearance-circle, .has-appearance-squareButton shape.

Headline sharing

Class / attributePurpose
[data-has-headline-share]Heading that has the share trigger.
.has-headline-share-triggerThe link/share icon button.
.has-headline-share-panelThe opened panel with network icons.
.has-headline-link-icon-always-visibleIcon always visible (no hover).

Creating a simple “theme” with CSS variables

You can define a small set of variables in one place and reuse them across the plugin’s features.

Example — one dark palette for HAS:

:root {
/* Inline highlight tooltip */
--has-inline-highlight-tooltips-background-color: #1e1e1e;
--has-inline-highlight-tooltips-color: #e0e0e0;

/* Image sharing */
--has-pinterest-button-color: #4a4a4a;
--has-pinterest-button-color-hover: #333;
--has-webshare-button-color: #5a5a5a;
--has-webshare-button-color-hover: #444;

/* Headline panel */
--has-headline-item-row-background: #2a2a2a;
--has-headline-item-row-background-hover: #3a3a3a;
--has-headline-item-row-text-color: #e8e8e8;
}

Put this in Appearance → Customize → Additional CSS


Scoping overrides (e.g., one page or one block)

To change styles only in certain places:

  • Only on posts: Use body.single .highlight-and-share-wrapper { ... } or body.post-type-post :root { ... } (variables on :root will still apply globally unless you set them on a closer ancestor.
  • Only for the Click to Share block: Target .wp-block-dlxplugins-has-click-to-share and set the --has-cta-* variables on that wrapper.
  • Only for image sharing: Target .has-pin-image-wrapper and set the --has-pinterest-* and --has-webshare-* variables on that wrapper (they inherit from :root by default).

Example — different image button colors only in the sidebar:

.sidebar .has-pin-image-wrapper {
--has-pinterest-button-color: #8b4513;
--has-webshare-button-color: #556b2f;
}