-
-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* New: Native Theme Engine Co-Authored-By: Zak Saunders <thezak48@users.noreply.github.com> (cherry picked from commit 2291f3e00eb2ff9268a0b2f49da8dde82ee13c04) * Update CSS for themes * Fixup CSS values * Fixup remove duped Color-Impaired setting * Fixup Link Colors Co-Authored-By: Qstick <qstick@gmail.com>
- Loading branch information
Showing
146 changed files
with
923 additions
and
481 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
.torrent { | ||
composes: label from '~Components/Label.css'; | ||
|
||
border-color: $torrentColor; | ||
background-color: $torrentColor; | ||
border-color: var(--torrentColor); | ||
background-color: var(--torrentColor); | ||
} | ||
|
||
.usenet { | ||
composes: label from '~Components/Label.css'; | ||
|
||
border-color: $usenetColor; | ||
background-color: $usenetColor; | ||
border-color: var(--usenetColor); | ||
background-color: var(--usenetColor); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import PropTypes from 'prop-types'; | ||
import React, { Fragment, useCallback, useEffect } from 'react'; | ||
import { connect } from 'react-redux'; | ||
import { createSelector } from 'reselect'; | ||
import themes from 'Styles/Themes'; | ||
|
||
function createMapStateToProps() { | ||
return createSelector( | ||
(state) => state.settings.ui.item.theme || window.Readarr.theme, | ||
( | ||
theme | ||
) => { | ||
return { | ||
theme | ||
}; | ||
} | ||
); | ||
} | ||
|
||
function ApplyTheme({ theme, children }) { | ||
// Update the CSS Variables | ||
const updateCSSVariables = useCallback(() => { | ||
const arrayOfVariableKeys = Object.keys(themes[theme]); | ||
const arrayOfVariableValues = Object.values(themes[theme]); | ||
|
||
// Loop through each array key and set the CSS Variables | ||
arrayOfVariableKeys.forEach((cssVariableKey, index) => { | ||
// Based on our snippet from MDN | ||
document.documentElement.style.setProperty( | ||
`--${cssVariableKey}`, | ||
arrayOfVariableValues[index] | ||
); | ||
}); | ||
}, [theme]); | ||
|
||
// On Component Mount and Component Update | ||
useEffect(() => { | ||
updateCSSVariables(theme); | ||
}, [updateCSSVariables, theme]); | ||
|
||
return <Fragment>{children}</Fragment>; | ||
} | ||
|
||
ApplyTheme.propTypes = { | ||
theme: PropTypes.string.isRequired, | ||
children: PropTypes.object.isRequired | ||
}; | ||
|
||
export default connect(createMapStateToProps)(ApplyTheme); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,5 +8,5 @@ | |
|
||
.deleteFilesMessage { | ||
margin-top: 20px; | ||
color: $dangerColor; | ||
color: var(--dangerColor); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ | |
|
||
.path { | ||
margin-left: 5px; | ||
color: $dangerColor; | ||
color: var(--dangerColor); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
.info { | ||
background-color: #fafbfc; | ||
background-color: var(--seriesBackgroundColor); | ||
text-align: center; | ||
font-size: $smallFontSize; | ||
} |
Oops, something went wrong.