Skip to content

Fix favicon CSS specifity#243351

Merged
kowalczyk-krzysztof merged 1 commit intoelastic:mainfrom
kowalczyk-krzysztof:fix/fix-favicon-dark-mode
Nov 19, 2025
Merged

Fix favicon CSS specifity#243351
kowalczyk-krzysztof merged 1 commit intoelastic:mainfrom
kowalczyk-krzysztof:fix/fix-favicon-dark-mode

Conversation

@kowalczyk-krzysztof
Copy link
Member

@kowalczyk-krzysztof kowalczyk-krzysztof commented Nov 18, 2025

Summary

This PR fixes the production build favicon being stuck in light mode version.

The SVG has a media query for dark mode (<style>@media (prefers-color-scheme:dark){path{fill:#fff}}</style>) but the default (light mode) style is defined inline on the <path> element (style="fill:#1c1e23").
Inline styles have higher specificity than the <style> tag, which causes the default color to always override dark mode variant.

This PR fixes this by moving the inline style to the <style> tag, similar to how the DEV favicon (src/core/packages/apps/server-internal/assets/favicons/favicon.svg) does it.

<style>path{fill:#1c1e23}@media (prefers-color-scheme:dark){path{fill:#fff}}</style>
 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 180 180">
-  <style>@media (prefers-color-scheme:dark){path{fill:#fff}}</style>
+  <style>path{fill:#1c1e23}@media (prefers-color-scheme:dark){path{fill:#fff}}</style>
   <path d="M180 94.27a35.54 35.54 0 0 0-23.43-33.52 50.82 50.82 0 0 0-91.12-39.58A27 27 0 0 0 23.62 52a35.88 35.88 0 0 0-17.18 54.26 35.5 35.5 0 0 0 17.1 13.07 51.6 51.6 0 0 0-.89 9.7 50.66 50.66 0 0 0 92 29.66 27 27 0 0 0 41.85-30.75A36 36 0 0 0 180 94.27M69.69 26.62a44.46 44.46 0 0 1 80.2 34l-39.73 34.9-39.39-18L63.08 61Zm-19.92-4.44a21.25 21.25 0 0 1 12.93 4.39l-6 30.78-27-6.4a21.43 21.43 0 0 1 20-28.77ZM7 85.77a30.16 30.16 0 0 1 20.41-28.39L57 64.4l7 14.91-37.89 34.38A29.88 29.88 0 0 1 7 85.77m103.53 67.61a44.52 44.52 0 0 1-81.35-25.12 45.5 45.5 0 0 1 .89-8.87l38.68-35.18 39.54 18.09 8.76 16.79Zm19.78 4.44a21 21 0 0 1-12.86-4.44l5.87-30.68 27 6.33a21.49 21.49 0 0 1-10.14 26.32 21.24 21.24 0 0 1-9.84 2.45Zm22.32-35.24-29.69-7-7.94-15.05 38.84-34.15A29.81 29.81 0 0 1 173 94.25a30.16 30.16 0 0 1-20.45 28.31Z"
-    style="fill:#1c1e23"/>
+  />
 </svg>

Closes: #241687

@kowalczyk-krzysztof kowalczyk-krzysztof self-assigned this Nov 18, 2025
@kowalczyk-krzysztof kowalczyk-krzysztof added bug Fixes for quality problems that affect the customer experience release_note:fix Team:SharedUX Platform AppEx-SharedUX (formerly Global Experience) t// backport:all-open Backport to all branches that could still receive a release ci:project-deploy-elasticsearch Create an Elasticsearch Serverless project labels Nov 18, 2025
@kibanamachine
Copy link
Contributor

@kowalczyk-krzysztof kowalczyk-krzysztof marked this pull request as ready for review November 18, 2025 13:58
@kowalczyk-krzysztof kowalczyk-krzysztof requested a review from a team as a code owner November 18, 2025 13:58
@elasticmachine
Copy link
Contributor

Pinging @elastic/appex-sharedux (Team:SharedUX)

@elasticmachine
Copy link
Contributor

elasticmachine commented Nov 18, 2025

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

cc @kowalczyk-krzysztof

@kowalczyk-krzysztof kowalczyk-krzysztof enabled auto-merge (squash) November 18, 2025 15:51
@kowalczyk-krzysztof kowalczyk-krzysztof changed the title Fix favicon style specifity Nov 18, 2025
@kowalczyk-krzysztof kowalczyk-krzysztof changed the title Fix favicon css specifity Nov 18, 2025
@kowalczyk-krzysztof kowalczyk-krzysztof removed the ci:project-deploy-elasticsearch Create an Elasticsearch Serverless project label Nov 18, 2025
@kowalczyk-krzysztof kowalczyk-krzysztof merged commit 8b823ad into elastic:main Nov 19, 2025
29 of 30 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19, 9.1, 9.2

https://github.com/elastic/kibana/actions/runs/19494196439

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 19, 2025
## Summary

This PR fixes the production build favicon being stuck in light mode
version.

The SVG has a media query for dark mode (`<style>@media
(prefers-color-scheme:dark){path{fill:#fff}}</style>`) but the default
(light mode) style is defined inline on the `<path>` element
(`style="fill:#1c1e23"`).
Inline styles have higher specificity than the `<style>` tag, which
causes the default color to always override dark mode variant.

This PR fixes this by moving the inline style to the `<style>` tag:
```svg
<style>path{fill:#1c1e23}@media (prefers-color-scheme:dark){path{fill:#fff}}</style>
```

Closes: elastic#241687
(cherry picked from commit 8b823ad)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 19, 2025
## Summary

This PR fixes the production build favicon being stuck in light mode
version.

The SVG has a media query for dark mode (`<style>@media
(prefers-color-scheme:dark){path{fill:#fff}}</style>`) but the default
(light mode) style is defined inline on the `<path>` element
(`style="fill:#1c1e23"`).
Inline styles have higher specificity than the `<style>` tag, which
causes the default color to always override dark mode variant.

This PR fixes this by moving the inline style to the `<style>` tag:
```svg
<style>path{fill:#1c1e23}@media (prefers-color-scheme:dark){path{fill:#fff}}</style>
```

Closes: elastic#241687
(cherry picked from commit 8b823ad)
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
8.19 Backport failed because of merge conflicts
9.1
9.2

Note: Successful backport PRs will be merged automatically after passing CI.

Manual backport

To create the backport manually run:

node scripts/backport --pr 243351

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Nov 19, 2025
# Backport

This will backport the following commits from `main` to `9.1`:
- [Fix favicon style specifity
(#243351)](#243351)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Krzysztof
Kowalczyk","email":"krzysztof.kowalczyk@elastic.co"},"sourceCommit":{"committedDate":"2025-11-19T08:05:25Z","message":"Fix
favicon style specifity (#243351)\n\n## Summary\n\nThis PR fixes the
production build favicon being stuck in light mode\nversion.\n\nThe SVG
has a media query for dark mode
(`<style>@media\n(prefers-color-scheme:dark){path{fill:#fff}}</style>`)
but the default\n(light mode) style is defined inline on the `<path>`
element\n(`style=\"fill:#1c1e23\"`).\nInline styles have higher
specificity than the `<style>` tag, which\ncauses the default color to
always override dark mode variant.\n\nThis PR fixes this by moving the
inline style to the `<style>`
tag:\n```svg\n<style>path{fill:#1c1e23}@media
(prefers-color-scheme:dark){path{fill:#fff}}</style>\n```\n\nCloses:
https://github.com/elastic/kibana/issues/241687","sha":"8b823ad7338fd344a7d8c2d38c50178035c2b7bb","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Team:SharedUX","backport:all-open","v9.3.0"],"title":"Fix
favicon CSS
specifity","number":243351,"url":"https://github.com/elastic/kibana/pull/243351","mergeCommit":{"message":"Fix
favicon style specifity (#243351)\n\n## Summary\n\nThis PR fixes the
production build favicon being stuck in light mode\nversion.\n\nThe SVG
has a media query for dark mode
(`<style>@media\n(prefers-color-scheme:dark){path{fill:#fff}}</style>`)
but the default\n(light mode) style is defined inline on the `<path>`
element\n(`style=\"fill:#1c1e23\"`).\nInline styles have higher
specificity than the `<style>` tag, which\ncauses the default color to
always override dark mode variant.\n\nThis PR fixes this by moving the
inline style to the `<style>`
tag:\n```svg\n<style>path{fill:#1c1e23}@media
(prefers-color-scheme:dark){path{fill:#fff}}</style>\n```\n\nCloses:
https://github.com/elastic/kibana/issues/241687","sha":"8b823ad7338fd344a7d8c2d38c50178035c2b7bb"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/243351","number":243351,"mergeCommit":{"message":"Fix
favicon style specifity (#243351)\n\n## Summary\n\nThis PR fixes the
production build favicon being stuck in light mode\nversion.\n\nThe SVG
has a media query for dark mode
(`<style>@media\n(prefers-color-scheme:dark){path{fill:#fff}}</style>`)
but the default\n(light mode) style is defined inline on the `<path>`
element\n(`style=\"fill:#1c1e23\"`).\nInline styles have higher
specificity than the `<style>` tag, which\ncauses the default color to
always override dark mode variant.\n\nThis PR fixes this by moving the
inline style to the `<style>`
tag:\n```svg\n<style>path{fill:#1c1e23}@media
(prefers-color-scheme:dark){path{fill:#fff}}</style>\n```\n\nCloses:
https://github.com/elastic/kibana/issues/241687","sha":"8b823ad7338fd344a7d8c2d38c50178035c2b7bb"}}]}]
BACKPORT-->

Co-authored-by: Krzysztof Kowalczyk <krzysztof.kowalczyk@elastic.co>
kibanamachine added a commit that referenced this pull request Nov 19, 2025
# Backport

This will backport the following commits from `main` to `9.2`:
- [Fix favicon style specifity
(#243351)](#243351)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Krzysztof
Kowalczyk","email":"krzysztof.kowalczyk@elastic.co"},"sourceCommit":{"committedDate":"2025-11-19T08:05:25Z","message":"Fix
favicon style specifity (#243351)\n\n## Summary\n\nThis PR fixes the
production build favicon being stuck in light mode\nversion.\n\nThe SVG
has a media query for dark mode
(`<style>@media\n(prefers-color-scheme:dark){path{fill:#fff}}</style>`)
but the default\n(light mode) style is defined inline on the `<path>`
element\n(`style=\"fill:#1c1e23\"`).\nInline styles have higher
specificity than the `<style>` tag, which\ncauses the default color to
always override dark mode variant.\n\nThis PR fixes this by moving the
inline style to the `<style>`
tag:\n```svg\n<style>path{fill:#1c1e23}@media
(prefers-color-scheme:dark){path{fill:#fff}}</style>\n```\n\nCloses:
https://github.com/elastic/kibana/issues/241687","sha":"8b823ad7338fd344a7d8c2d38c50178035c2b7bb","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Team:SharedUX","backport:all-open","v9.3.0"],"title":"Fix
favicon CSS
specifity","number":243351,"url":"https://github.com/elastic/kibana/pull/243351","mergeCommit":{"message":"Fix
favicon style specifity (#243351)\n\n## Summary\n\nThis PR fixes the
production build favicon being stuck in light mode\nversion.\n\nThe SVG
has a media query for dark mode
(`<style>@media\n(prefers-color-scheme:dark){path{fill:#fff}}</style>`)
but the default\n(light mode) style is defined inline on the `<path>`
element\n(`style=\"fill:#1c1e23\"`).\nInline styles have higher
specificity than the `<style>` tag, which\ncauses the default color to
always override dark mode variant.\n\nThis PR fixes this by moving the
inline style to the `<style>`
tag:\n```svg\n<style>path{fill:#1c1e23}@media
(prefers-color-scheme:dark){path{fill:#fff}}</style>\n```\n\nCloses:
https://github.com/elastic/kibana/issues/241687","sha":"8b823ad7338fd344a7d8c2d38c50178035c2b7bb"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/243351","number":243351,"mergeCommit":{"message":"Fix
favicon style specifity (#243351)\n\n## Summary\n\nThis PR fixes the
production build favicon being stuck in light mode\nversion.\n\nThe SVG
has a media query for dark mode
(`<style>@media\n(prefers-color-scheme:dark){path{fill:#fff}}</style>`)
but the default\n(light mode) style is defined inline on the `<path>`
element\n(`style=\"fill:#1c1e23\"`).\nInline styles have higher
specificity than the `<style>` tag, which\ncauses the default color to
always override dark mode variant.\n\nThis PR fixes this by moving the
inline style to the `<style>`
tag:\n```svg\n<style>path{fill:#1c1e23}@media
(prefers-color-scheme:dark){path{fill:#fff}}</style>\n```\n\nCloses:
https://github.com/elastic/kibana/issues/241687","sha":"8b823ad7338fd344a7d8c2d38c50178035c2b7bb"}}]}]
BACKPORT-->

Co-authored-by: Krzysztof Kowalczyk <krzysztof.kowalczyk@elastic.co>
@kowalczyk-krzysztof
Copy link
Member Author

💚 All backports created successfully

Status Branch Result
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kowalczyk-krzysztof added a commit that referenced this pull request Nov 19, 2025
# Backport

This will backport the following commits from `main` to `8.19`:
- [Fix favicon style specifity
(#243351)](#243351)

<!--- Backport version: 10.2.0 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Krzysztof
Kowalczyk","email":"krzysztof.kowalczyk@elastic.co"},"sourceCommit":{"committedDate":"2025-11-19T08:05:25Z","message":"Fix
favicon style specifity (#243351)\n\n## Summary\n\nThis PR fixes the
production build favicon being stuck in light mode\nversion.\n\nThe SVG
has a media query for dark mode
(`<style>@media\n(prefers-color-scheme:dark){path{fill:#fff}}</style>`)
but the default\n(light mode) style is defined inline on the `<path>`
element\n(`style=\"fill:#1c1e23\"`).\nInline styles have higher
specificity than the `<style>` tag, which\ncauses the default color to
always override dark mode variant.\n\nThis PR fixes this by moving the
inline style to the `<style>`
tag:\n```svg\n<style>path{fill:#1c1e23}@media
(prefers-color-scheme:dark){path{fill:#fff}}</style>\n```\n\nCloses:
https://github.com/elastic/kibana/issues/241687","sha":"8b823ad7338fd344a7d8c2d38c50178035c2b7bb","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Team:SharedUX","backport:all-open","v9.3.0","v9.2.2","v9.1.8"],"title":"Fix
favicon CSS
specifity","number":243351,"url":"https://github.com/elastic/kibana/pull/243351","mergeCommit":{"message":"Fix
favicon style specifity (#243351)\n\n## Summary\n\nThis PR fixes the
production build favicon being stuck in light mode\nversion.\n\nThe SVG
has a media query for dark mode
(`<style>@media\n(prefers-color-scheme:dark){path{fill:#fff}}</style>`)
but the default\n(light mode) style is defined inline on the `<path>`
element\n(`style=\"fill:#1c1e23\"`).\nInline styles have higher
specificity than the `<style>` tag, which\ncauses the default color to
always override dark mode variant.\n\nThis PR fixes this by moving the
inline style to the `<style>`
tag:\n```svg\n<style>path{fill:#1c1e23}@media
(prefers-color-scheme:dark){path{fill:#fff}}</style>\n```\n\nCloses:
https://github.com/elastic/kibana/issues/241687","sha":"8b823ad7338fd344a7d8c2d38c50178035c2b7bb"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/243351","number":243351,"mergeCommit":{"message":"Fix
favicon style specifity (#243351)\n\n## Summary\n\nThis PR fixes the
production build favicon being stuck in light mode\nversion.\n\nThe SVG
has a media query for dark mode
(`<style>@media\n(prefers-color-scheme:dark){path{fill:#fff}}</style>`)
but the default\n(light mode) style is defined inline on the `<path>`
element\n(`style=\"fill:#1c1e23\"`).\nInline styles have higher
specificity than the `<style>` tag, which\ncauses the default color to
always override dark mode variant.\n\nThis PR fixes this by moving the
inline style to the `<style>`
tag:\n```svg\n<style>path{fill:#1c1e23}@media
(prefers-color-scheme:dark){path{fill:#fff}}</style>\n```\n\nCloses:
https://github.com/elastic/kibana/issues/241687","sha":"8b823ad7338fd344a7d8c2d38c50178035c2b7bb"}},{"branch":"9.2","label":"v9.2.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/243442","number":243442,"state":"MERGED","mergeCommit":{"sha":"c84f3438981763ca4d68a27d9328c7b135c887c6","message":"[9.2]
Fix favicon style specifity (#243351) (#243442)\n\n# Backport\n\nThis
will backport the following commits from `main` to `9.2`:\n- [Fix
favicon style
specifity\n(#243351)](https://github.com/elastic/kibana/pull/243351)\n\n\n\n###
Questions ?\nPlease refer to the [Backport
tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by:
Krzysztof Kowalczyk
<krzysztof.kowalczyk@elastic.co>"}},{"branch":"9.1","label":"v9.1.8","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/243441","number":243441,"state":"MERGED","mergeCommit":{"sha":"795e7129085fbdcd8810552925e09b6942ebbbd8","message":"[9.1]
Fix favicon style specifity (#243351) (#243441)\n\n# Backport\n\nThis
will backport the following commits from `main` to `9.1`:\n- [Fix
favicon style
specifity\n(#243351)](https://github.com/elastic/kibana/pull/243351)\n\n\n\n###
Questions ?\nPlease refer to the [Backport
tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by:
Krzysztof Kowalczyk <krzysztof.kowalczyk@elastic.co>"}}]}] BACKPORT-->
@kowalczyk-krzysztof kowalczyk-krzysztof deleted the fix/fix-favicon-dark-mode branch November 19, 2025 13:11
alexreal1314 pushed a commit to alexreal1314/kibana that referenced this pull request Nov 20, 2025
## Summary

This PR fixes the production build favicon being stuck in light mode
version.

The SVG has a media query for dark mode (`<style>@media
(prefers-color-scheme:dark){path{fill:#fff}}</style>`) but the default
(light mode) style is defined inline on the `<path>` element
(`style="fill:#1c1e23"`).
Inline styles have higher specificity than the `<style>` tag, which
causes the default color to always override dark mode variant.

This PR fixes this by moving the inline style to the `<style>` tag:
```svg
<style>path{fill:#1c1e23}@media (prefers-color-scheme:dark){path{fill:#fff}}</style>
```

Closes: elastic#241687
eokoneyo pushed a commit to eokoneyo/kibana that referenced this pull request Dec 2, 2025
## Summary

This PR fixes the production build favicon being stuck in light mode
version.

The SVG has a media query for dark mode (`<style>@media
(prefers-color-scheme:dark){path{fill:#fff}}</style>`) but the default
(light mode) style is defined inline on the `<path>` element
(`style="fill:#1c1e23"`).
Inline styles have higher specificity than the `<style>` tag, which
causes the default color to always override dark mode variant.

This PR fixes this by moving the inline style to the `<style>` tag:
```svg
<style>path{fill:#1c1e23}@media (prefers-color-scheme:dark){path{fill:#fff}}</style>
```

Closes: elastic#241687
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:all-open Backport to all branches that could still receive a release bug Fixes for quality problems that affect the customer experience release_note:fix Team:SharedUX Platform AppEx-SharedUX (formerly Global Experience) t// v8.19.8 v9.1.8 v9.2.2 v9.3.0

4 participants