fix: deduplicate settings styles (#1564)

This commit is contained in:
Nolan Lawson 2019-10-10 07:06:04 -07:00 committed by GitHub
parent 7dde0a833b
commit 138fe83082
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 54 deletions

View file

@ -0,0 +1,20 @@
<style>
:global(.ui-settings) {
background: var(--form-bg);
border: 1px solid var(--main-border);
border-radius: 4px;
padding: 20px;
line-height: 2em;
}
:global(.setting-group) {
display: block;
padding: 5px 0;
}
@media (max-width: 240px) {
:global(.ui-settings) {
padding: 20px 10px;
}
}
</style>

View file

@ -90,36 +90,20 @@
<ThemeSettings instanceName={$currentInstance} /> <ThemeSettings instanceName={$currentInstance} />
{/if} {/if}
</SettingsLayout> </SettingsLayout>
<style> <UISettingsStyles />
.ui-settings {
background: var(--form-bg);
border: 1px solid var(--main-border);
border-radius: 4px;
padding: 20px;
line-height: 2em;
}
.setting-group {
display: block;
padding: 5px 0;
}
@media (max-width: 240px) {
.ui-settings {
padding: 20px 10px;
}
}
</style>
<script> <script>
import SettingsLayout from '../../_components/settings/SettingsLayout.html' import SettingsLayout from '../../_components/settings/SettingsLayout.html'
import ThemeSettings from '../../_components/settings/instance/ThemeSettings.html' import ThemeSettings from '../../_components/settings/instance/ThemeSettings.html'
import { store } from '../../_store/store' import { store } from '../../_store/store'
import Tooltip from '../../_components/Tooltip.html' import Tooltip from '../../_components/Tooltip.html'
import UISettingsStyles from '../../_components/settings/UISettingsStyles.html'
export default { export default {
components: { components: {
SettingsLayout, SettingsLayout,
ThemeSettings, ThemeSettings,
Tooltip Tooltip,
UISettingsStyles
}, },
methods: { methods: {
onChange (event) { onChange (event) {

View file

@ -25,35 +25,22 @@
<ShortcutHelpInfo /> <ShortcutHelpInfo />
</SettingsLayout> </SettingsLayout>
<UISettingsStyles />
<style> <style>
.ui-settings { .ui-settings {
background: var(--form-bg);
border: 1px solid var(--main-border);
border-radius: 4px;
padding: 20px;
line-height: 2em;
margin-bottom: 20px; margin-bottom: 20px;
} }
.setting-group {
display: block;
padding: 5px 0;
}
label.disabled-style { label.disabled-style {
color: var(--deemphasized-text-color); color: var(--deemphasized-text-color);
} }
@media (max-width: 240px) {
.ui-settings {
padding: 20px 10px;
}
}
</style> </style>
<script> <script>
import SettingsLayout from '../../_components/settings/SettingsLayout.html' import SettingsLayout from '../../_components/settings/SettingsLayout.html'
import ShortcutHelpInfo from '../../_components/ShortcutHelpInfo.html' import ShortcutHelpInfo from '../../_components/ShortcutHelpInfo.html'
import { store } from '../../_store/store' import { store } from '../../_store/store'
import { isKaiOS } from '../../_utils/userAgent' import { isKaiOS } from '../../_utils/userAgent'
import UISettingsStyles from '../../_components/settings/UISettingsStyles.html'
export default { export default {
store: () => store, store: () => store,
@ -72,7 +59,8 @@
}, },
components: { components: {
SettingsLayout, SettingsLayout,
ShortcutHelpInfo ShortcutHelpInfo,
UISettingsStyles
} }
} }
</script> </script>

View file

@ -63,33 +63,18 @@
<ExternalLink href="https://humanetech.com">Center for Humane Technology</ExternalLink>. <ExternalLink href="https://humanetech.com">Center for Humane Technology</ExternalLink>.
</p> </p>
</SettingsLayout> </SettingsLayout>
<UISettingsStyles />
<style> <style>
.ui-settings {
background: var(--form-bg);
border: 1px solid var(--main-border);
border-radius: 4px;
padding: 20px;
line-height: 2em;
}
.setting-group {
display: block;
padding: 5px 0;
}
:global(.wellness-aside) { :global(.wellness-aside) {
margin: 20px 10px 0px 10px; margin: 20px 10px 0px 10px;
} }
@media (max-width: 240px) {
.ui-settings {
padding: 20px 10px;
}
}
</style> </style>
<script> <script>
import SettingsLayout from '../../_components/settings/SettingsLayout.html' import SettingsLayout from '../../_components/settings/SettingsLayout.html'
import { store } from '../../_store/store' import { store } from '../../_store/store'
import ExternalLink from '../../_components/ExternalLink.html' import ExternalLink from '../../_components/ExternalLink.html'
import InfoAside from '../../_components/InfoAside.html' import InfoAside from '../../_components/InfoAside.html'
import UISettingsStyles from '../../_components/settings/UISettingsStyles.html'
export default { export default {
oncreate () { oncreate () {
@ -98,7 +83,8 @@
components: { components: {
SettingsLayout, SettingsLayout,
ExternalLink, ExternalLink,
InfoAside InfoAside,
UISettingsStyles
}, },
methods: { methods: {
flushChangesToCheckAll () { flushChangesToCheckAll () {