Skip to content

Commit

Permalink
optimzations for dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
bennyborn committed Nov 28, 2024
1 parent 8bc50e2 commit 0fdaf5f
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 5 deletions.
9 changes: 9 additions & 0 deletions src/Resources/public/backend.css
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,12 @@ fieldset[data-contao--toggle-fieldset-id-value="twitter_legend"] legend button:b
background: url("/bundles/opengraph3/icon-twitter.svg") no-repeat scroll 50% 50%;
background-size: contain;
}

html[data-color-scheme="dark"] fieldset[data-contao--toggle-fieldset-id-value="opengraph_legend"] legend button:before {
background-image: url("/bundles/opengraph3/icon-ogp_1c.svg");
}

html[data-color-scheme="dark"] fieldset[data-contao--toggle-fieldset-id-value="opengraph_legend"] legend button:before,
html[data-color-scheme="dark"] fieldset[data-contao--toggle-fieldset-id-value="twitter_legend"] legend button:before {
filter: brightness(0) invert(50%) sepia(24%) saturate(224%) hue-rotate(184deg) brightness(91%) contrast(90%);
}
12 changes: 12 additions & 0 deletions src/Resources/public/backend.scss
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,16 @@ fieldset[data-contao--toggle-fieldset-id-value="twitter_legend"] legend button,
background: url('/bundles/opengraph3/icon-twitter.svg') no-repeat scroll 50% 50%;
background-size: contain;
}
}

html[data-color-scheme="dark"] {

fieldset[data-contao--toggle-fieldset-id-value="opengraph_legend"] legend button:before {
background-image: url('/bundles/opengraph3/icon-ogp_1c.svg');
}

fieldset[data-contao--toggle-fieldset-id-value="opengraph_legend"] legend button:before,
fieldset[data-contao--toggle-fieldset-id-value="twitter_legend"] legend button:before {
filter: brightness(0) invert(50%) sepia(24%) saturate(224%) hue-rotate(184deg) brightness(91%) contrast(90%);
}
}
59 changes: 59 additions & 0 deletions src/Resources/public/icon-ogp_1c.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 1 addition & 5 deletions src/Resources/public/icon-twitter.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0fdaf5f

Please sign in to comment.