Skip to content

Content Thumbnail icon has wrong filter in dark mode #10147#10172

Open
ashklianko wants to merge 1 commit intomasterfrom
issue-10147
Open

Content Thumbnail icon has wrong filter in dark mode #10147#10172
ashklianko wants to merge 1 commit intomasterfrom
issue-10147

Conversation

@ashklianko
Copy link
Copy Markdown
Member

- Reverting changes made in #9461: custom icons can be multicolor svgs/pngs, applying filters can make them look worse. Other solutions must be implemented for dark mode icons
@alansemenov
Copy link
Copy Markdown
Member

Can't we tell content type icons from thumbnails? And only apply filter to the former?

@ashklianko
Copy link
Copy Markdown
Member Author

https://developer.enonic.com/docs/xp/stable/cms/content-types#custom_content_types

Content types may use multicolor svg/png, we can't know how applying filter will result for them.

@ashklianko
Copy link
Copy Markdown
Member Author

ashklianko commented Mar 31, 2026

Two potential solution:

  1. Add white background behind icons in dark mode (looks bad bad guarantees all icons are seen)
  2. Introduce dart mode icons in content types: <content_type_name.ext> icon for standard/fallback (as it is now) and <content_type_name-dark.ext> for dark mode

No filters for thumbnails ofc

type BuiltInIconProps = Pick<Props, 'contentType'> & React.ComponentProps<LucideIcon>;

const IMAGE_TYPES = new Set<string>([
const IMAGE_CONTENT_TYPES = new Set<string>([
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure all those renames are reasonable, since we do not export them, and do not add more similar variables

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For sake of clarity - to specify it is not mime types but our own content types

@edloidas
Copy link
Copy Markdown
Member

So the problem is with 3rd party icons and images only. I suggest we try drop-shadow instead of other filters for img. Won't look great either, but better than the square border or full background. E.g.:

filter: drop-shadow(0 0 1px rgba(255,255,255,1));
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Content Thumbnail icon has wrong filter in dark mode

3 participants