diff --git a/src/routes/Settings/SectionsList/SectionsList.js b/src/routes/Settings/SectionsList/SectionsList.js index 48b940f40..8611e53c3 100644 --- a/src/routes/Settings/SectionsList/SectionsList.js +++ b/src/routes/Settings/SectionsList/SectionsList.js @@ -2,7 +2,7 @@ const React = require('react'); const { Button, Dropdown, Checkbox, ColorInput } = require('stremio/common'); const Icon = require('stremio-icons/dom/Icon'); const classnames = require('classnames'); -const styles = require('../styles'); +const styles = require('./styles'); const SectionsList = React.forwardRef(({ className, sections, preferences, onPreferenceChanged, onScroll }, ref) => { const scrollContainerRef = ref; diff --git a/src/routes/Settings/SectionsList/styles.less b/src/routes/Settings/SectionsList/styles.less new file mode 100644 index 000000000..d7b647535 --- /dev/null +++ b/src/routes/Settings/SectionsList/styles.less @@ -0,0 +1,181 @@ +:import('~stremio/common/Checkbox/styles.less') { + checkbox-icon: icon; +} + +.section { + padding: 4rem 2rem; + + .section-header { + margin: 0 1.5rem 1.5rem 1.5rem; + font-size: 2rem; + color: var(--color-surfacelighter); + } + + .input-container { + margin: 1.5rem; + display: flex; + flex-direction: column; + + .input-header { + margin-bottom: 0.5rem; + color: var(--color-surfacelighter); + } + + .checkbox-icon { + flex: none; + width: 1.2rem; + height: 1.2rem; + fill: var(--color-surfacelight); + } + + &.user-container { + flex-direction: row; + align-items: center; + + .avatar { + margin: 0 1rem; + width: 4.2rem; + height: 4.2rem; + border-radius: 50%; + border: var(--focusable-border-size) solid var(--color-primary); + background-size: cover; + background-position: center; + background-repeat: no-repeat; + } + + .email { + color: var(--color-surfacelighter); + } + } + + &.select-container { + .dropdown { + height: 3rem; + width: var(--input-width); + } + } + + &.link-container { + margin: 1rem 1.5rem; + + .link { + display: block; + color: var(--color-secondarylight); + + &:focus { + color: var(--color-surface); + } + + &:hover { + color: var(--color-surfacelighter); + } + } + } + + &.button-container { + .button { + padding: 0.7rem; + width: var(--input-width); + min-height: calc(var(--input-width) * 0.09); + display: flex; + align-items: center; + justify-content: center; + background-color: var(--color-primary); + cursor: pointer; + + .icon { + width: 1.4rem; + height: 100%; + margin-right: 0.5rem; + fill: var(--color-surfacelighter); + } + + .label { + color: var(--color-surfacelighter); + } + + &:focus { + border-color: var(--color-surfacelighter); + } + + &:hover { + border-color: transparent; + background-color: var(--color-primarylight); + } + } + } + + &.checkbox-container { + .checkbox { + display: flex; + flex-direction: row; + align-items: center; + cursor: pointer; + + .label { + width: 100%; + margin-left: 0.5rem; + color: var(--color-surfacelight); + } + + &:focus, + &:hover { + .checkbox-icon { + fill: var(--color-surfacelighter); + } + + .label { + color: var(--color-surfacelighter); + } + } + } + } + + &.text-container { + .text { + display: flex; + flex-direction: row; + align-items: center; + + .icon { + margin-right: 0.5rem; + width: 1rem; + height: 1rem; + fill: var(--color-signal5); + } + + .x-icon { + margin-right: 0.5rem; + width: 1rem; + height: 1rem; + fill: var(--color-signal2); + } + + .label { + width: 100%; + color: var(--color-surfacelighter); + } + } + } + + &.color-container { + .color-picker { + width: var(--input-width); + height: calc(var(--input-width) * 0.08); + cursor: pointer; + + &:focus { + border-color: var(--color-surfacelighter); + } + + &:hover { + border-color: transparent; + } + } + } + } + + >:last-child { + margin-bottom: 0; + } +} \ No newline at end of file diff --git a/src/routes/Settings/SectionsSelector/SectionsSelector.js b/src/routes/Settings/SectionsSelector/SectionsSelector.js index 0cfcce343..a1f08dd12 100644 --- a/src/routes/Settings/SectionsSelector/SectionsSelector.js +++ b/src/routes/Settings/SectionsSelector/SectionsSelector.js @@ -2,7 +2,7 @@ const React = require('react'); const PropTypes = require('prop-types'); const { Button } = require('stremio/common'); const classnames = require('classnames'); -const styles = require('../styles'); +const styles = require('./styles'); const SectionsSelector = ({ className, sections, selectedSectionId, onSelectedSection }) => { return ( diff --git a/src/routes/Settings/SectionsSelector/styles.less b/src/routes/Settings/SectionsSelector/styles.less new file mode 100644 index 000000000..f4a15c2a8 --- /dev/null +++ b/src/routes/Settings/SectionsSelector/styles.less @@ -0,0 +1,26 @@ +.section-label { + padding: 1rem; + font-size: 1.1rem; + border: calc(var(--focusable-border-size) * 0.5) solid transparent; + color: var(--color-surfacelight); + cursor: pointer; + + &.selected { + color: var(--color-surfacelighter); + background-color: var(--color-background); + + &:hover { + background-color: var(--color-background); + } + } + + &:focus { + border-color: var(--color-surfacelighter); + } + + &:hover { + color: var(--color-surfacelighter); + background-color: var(--color-surface20); + border-color: transparent; + } +} \ No newline at end of file diff --git a/src/routes/Settings/styles.less b/src/routes/Settings/styles.less index 7cde2ab69..df5281628 100644 --- a/src/routes/Settings/styles.less +++ b/src/routes/Settings/styles.less @@ -1,7 +1,3 @@ -:import('~stremio/common/Checkbox/styles.less') { - checkbox-icon: icon; -} - .settings-parent-container { display: flex; flex-direction: column; @@ -29,32 +25,7 @@ flex-direction: column; background-color: var(--color-backgroundlighter); - .section-label { - padding: 1rem; - font-size: 1.1rem; - border: calc(var(--focusable-border-size) * 0.5) solid transparent; - color: var(--color-surfacelight); - cursor: pointer; - &.selected { - color: var(--color-surfacelighter); - background-color: var(--color-background); - - &:hover { - background-color: var(--color-background); - } - } - - &:focus { - border-color: var(--color-surfacelighter); - } - - &:hover { - color: var(--color-surfacelighter); - background-color: var(--color-surface20); - border-color: transparent; - } - } } .scroll-container { @@ -62,183 +33,6 @@ flex: 1; overflow-y: auto; - .section { - padding: 4rem 2rem; - - .section-header { - margin: 0 1.5rem 1.5rem 1.5rem; - font-size: 2rem; - color: var(--color-surfacelighter); - } - - .input-container { - margin: 1.5rem; - display: flex; - flex-direction: column; - - .input-header { - margin-bottom: 0.5rem; - color: var(--color-surfacelighter); - } - - .checkbox-icon { - flex: none; - width: 1.2rem; - height: 1.2rem; - fill: var(--color-surfacelight); - } - - &.user-container { - flex-direction: row; - align-items: center; - - .avatar { - margin: 0 1rem; - width: 4.2rem; - height: 4.2rem; - border-radius: 50%; - border: var(--focusable-border-size) solid var(--color-primary); - background-size: cover; - background-position: center; - background-repeat: no-repeat; - } - - .email { - color: var(--color-surfacelighter); - } - } - - &.select-container { - .dropdown { - height: 3rem; - width: var(--input-width); - } - } - - &.link-container { - margin: 1rem 1.5rem; - - .link { - display: block; - color: var(--color-secondarylight); - - &:focus { - color: var(--color-surface); - } - - &:hover { - color: var(--color-surfacelighter); - } - } - } - - &.button-container { - .button { - padding: 0.7rem; - width: var(--input-width); - min-height: calc(var(--input-width) * 0.09); - display: flex; - align-items: center; - justify-content: center; - background-color: var(--color-primary); - cursor: pointer; - - .icon { - width: 1.4rem; - height: 100%; - margin-right: 0.5rem; - fill: var(--color-surfacelighter); - } - - .label { - color: var(--color-surfacelighter); - } - - &:focus { - border-color: var(--color-surfacelighter); - } - - &:hover { - border-color: transparent; - background-color: var(--color-primarylight); - } - } - } - - &.checkbox-container { - .checkbox { - display: flex; - flex-direction: row; - align-items: center; - cursor: pointer; - - .label { - width: 100%; - margin-left: 0.5rem; - color: var(--color-surfacelight); - } - - &:focus, &:hover { - .checkbox-icon { - fill: var(--color-surfacelighter); - } - - .label { - color: var(--color-surfacelighter); - } - } - } - } - - &.text-container { - .text { - display: flex; - flex-direction: row; - align-items: center; - - .icon { - margin-right: 0.5rem; - width: 1rem; - height: 1rem; - fill: var(--color-signal5); - } - - .x-icon { - margin-right: 0.5rem; - width: 1rem; - height: 1rem; - fill: var(--color-signal2); - } - - .label { - width: 100%; - color: var(--color-surfacelighter); - } - } - } - - &.color-container { - .color-picker { - width: var(--input-width); - height: calc(var(--input-width) * 0.08); - cursor: pointer; - - &:focus { - border-color: var(--color-surfacelighter); - } - - &:hover { - border-color: transparent; - } - } - } - } - - >:last-child { - margin-bottom: 0; - } - } - >:not(:last-child) { border-bottom: calc(var(--focusable-border-size) * 0.5) solid var(--color-primary); }