Jump to content
View in the app

A better way to browse. Learn more.

Invision Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Different Advertisements For Light and Dark Modes

Featured Replies

  • Community Expert

I see in v5 there can be different site logos used for light and dark modes. Using code like --set__logo-light, ipsLogo__image--light, and data-ips-prefers-color-scheme="light".

Question: Is it possible to use any of the existing classes or selectors in our own custom HTML for advertisements that would enable a banner to be shown based on light or dark theme? For example, if theme=dark, show banner A, else show banner B. Or, is there another way to do this?

Edited by Chris027

Solved by Ehren

  • Author
  • Community Expert

Or, can we get a toggle like this to supply different code for different modes?

Screenshot 2026-05-17 at 6.47.33 PM.png

Using the class ipsLogo__image--light technically works, but not really. If the advertisement is selected to show, but the person is using dark mode, then no image shows.

Perhaps there is better html code I can write, with an if ipsLogo__image--light then image Z, if ipsLogo__image--dark then image B.

  • Author
  • Community Expert

OK, I think I figured out a way to do it, but unsure if it's the best.

<a href="LINK_HERE">

<!-- Light mode image (hidden in dark mode) -->

<img class="ipsLogo__image--light" src="PATH_TO_YOUR_DARK_IMAGE" alt="light-image">

<!-- Dark mode image (hidden in light mode) -->

<img class="ipsLogo__image--dark" src="PATH_TO_YOUR_DARK_IMAGE" alt="dark-image">

</a>

  • Solution

Those classes should only be used for the logo. Use this instead:

<a href="LINK_HERE">
	<!-- Light mode image (hidden in dark mode) -->
	<img class="i-display_light" src="PATH_TO_YOUR_LIGHT_IMAGE" alt="light-image" loading="lazy">
	<!-- Dark mode image (hidden in light mode) -->
	<img class="i-display_dark" src="PATH_TO_YOUR_DARK_IMAGE" alt="dark-image" loading="lazy">
</a>

  • Author
  • Community Expert
19 minutes ago, Ehren said:

Those classes should only be used for the logo. Use this instead:

<a href="LINK_HERE">
	<!-- Light mode image (hidden in dark mode) -->
	<img class="i-display_light" src="PATH_TO_YOUR_LIGHT_IMAGE" alt="light-image" loading="lazy">
	<!-- Dark mode image (hidden in light mode) -->
	<img class="i-display_dark" src="PATH_TO_YOUR_DARK_IMAGE" alt="dark-image" loading="lazy">
</a>

Thanks @Ehren !

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.