# extendify/3.2.1/src/Notifications/colors.js

Extendify, version 3.2.1. 53 lines.

- Page: https://pluginprobe.com/plugins/extendify/3.2.1/code/src/Notifications/colors.js
- Raw: https://pluginprobe.com/plugins/extendify/3.2.1/raw/src/Notifications/colors.js
- Modified: 2026-08-27T17:39:28+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/extendify/3.2.1/code/src/Notifications/colors.js#L10-L20`.

```javascript
// `--ext-*` resolves once at the scope root, so setting it here reaches nothing.
const BAR_SURFACE = {
	main: '--color-design-main',
	text: '--color-design-text',
};

// No partner color behind the card, so it has no `--color-*` alias to set.
const CARD_SURFACE = {
	main: '--ext-notification-card-main',
	text: '--ext-notification-card-text',
};

const buttonMap = (main, text) => ({
	'button-main': main,
	'button-text': text,
	'button-hover-main': '--ext-notification-button-hover-main',
	'button-hover-text': '--ext-notification-button-hover-text',
});

const BANNER_BUTTON = buttonMap('--color-banner-main', '--color-banner-text');
const DESIGN_BUTTON = buttonMap('--color-design-main', '--color-design-text');

const variablesFrom = (map, colors) =>
	Object.fromEntries(
		Object.entries(colors)
			.filter(([key, value]) => map[key] && typeof value === 'string')
			.map(([key, value]) => [map[key], value]),
	);

export const colorsOf = (notification) => notification?.colors ?? {};

export const barVariables = (colors) => variablesFrom(BAR_SURFACE, colors);

export const cardVariables = (colors) => variablesFrom(CARD_SURFACE, colors);

export const bannerButtonVariables = (colors) =>
	variablesFrom(BANNER_BUTTON, colors);

export const designButtonVariables = (colors) =>
	variablesFrom(DESIGN_BUTTON, colors);

export const buttonHoverClasses = (colors) => ({
	'hover:bg-[var(--ext-notification-button-hover-main)]': Boolean(
		colors['button-hover-main'],
	),
	'hover:text-[var(--ext-notification-button-hover-text)]': Boolean(
		colors['button-hover-text'],
	),
	// A supplied hover color has to land exactly, not dimmed.
	'hover:opacity-90':
		!colors['button-hover-main'] && !colors['button-hover-text'],
});

```
