From aa0564406a95824cc45c815571292716b65806a1 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sat, 31 Mar 2018 21:14:36 +0300 Subject: getting rid of baseXX, some small fixes. Seems to be usable. --- src/App.scss | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 77 insertions(+), 2 deletions(-) (limited to 'src/App.scss') diff --git a/src/App.scss b/src/App.scss index 95a653ce..6e0378db 100644 --- a/src/App.scss +++ b/src/App.scss @@ -33,14 +33,18 @@ body { font-family: sans-serif; font-size: 14px; margin: 0; + color: var(--fg); } a { text-decoration: none; + color: var(--link); } button{ user-select: none; + color: var(--faint); + background-color: var(--btn); border: none; border-radius: 5px; cursor: pointer; @@ -50,6 +54,8 @@ button{ font-size: 14px; font-family: sans-serif; + + &:hover { box-shadow: 0px 0px 4px rgba(255, 255, 255, 0.3); } @@ -58,8 +64,72 @@ button{ cursor: not-allowed; opacity: 0.5; } + + &.pressed { + color: var(--faint); + background-color: var(--bg) + } +} + + +input, textarea, select { + border: none; + border-radius: 5px; + border-bottom: 1px solid rgba(255, 255, 255, 0.2); + border-top: 1px solid rgba(0, 0, 0, 0.2); + box-shadow: 0px 0px 2px black inset; + background-color: var(--lightBg); + color: var(--lightFg); + font-family: sans-serif; + font-size: 14px; + padding: 5px; + + // TODO: Restyle in a decent way. Needs different markup // -webkit-appearance:none; @@ -93,7 +100,8 @@ input, textarea, select { &[type=checkbox] { display: none; &:checked + label::before { - color: var(--fg); + color: $fallback--fg; + color: var(--fg, $fallback--fg); } + label::before { display: inline-block; @@ -106,7 +114,8 @@ input, textarea, select { border-top: 1px solid rgba(0, 0, 0, 0.2); box-shadow: 0px 0px 2px black inset; margin-right: .5em; - background-color: var(--btn); + background-color: $fallback--btn; + background-color: var(--btn, $fallback--btn); vertical-align: baseline; text-align: center; line-height: 1.1em; @@ -126,129 +135,136 @@ input, textarea, select { .icon-binoculars, .icon-plus-squared, .icon-spin4 { - color: var(--icon) + color: $fallback--icon; + color: var(--icon, $fallback--icon) } .container { - display: flex; - flex-wrap: wrap; - margin: 0; - padding: 0 10px 0 10px; + display: flex; + flex-wrap: wrap; + margin: 0; + padding: 0 10px 0 10px; } .gaps { - margin: -1em 0 0 -1em; + margin: -1em 0 0 -1em; } .item { - flex: 1; - line-height: 25px; - height: 25px; - overflow: hidden; + flex: 1; + line-height: 25px; + height: 25px; + overflow: hidden; - .nav-icon { - font-size: 1.1em; - margin-left: 0.4em; - } + .nav-icon { + font-size: 1.1em; + margin-left: 0.4em; + } } .gaps > .item { - padding: 1em 0 0 1em; + padding: 1em 0 0 1em; } .auto-size { - flex: 1 + flex: 1 } nav { - width: 100%; + width: 100%; + align-items: center; + position: fixed; + height: 50px; + + .inner-nav { + padding-left: 20px; + padding-right: 20px; + display: flex; align-items: center; - position: fixed; + flex-basis: 970px; + margin: auto; height: 50px; - - .inner-nav { - padding-left: 20px; - padding-right: 20px; - display: flex; - align-items: center; - flex-basis: 970px; - margin: auto; - height: 50px; - background-repeat: no-repeat; - background-position: center; - background-size: contain; - } + background-repeat: no-repeat; + background-position: center; + background-size: contain; + } } main-router { - flex: 1; + flex: 1; } .status.compact { - color: rgba(0, 0, 0, 0.42); - font-weight: 300; + color: rgba(0, 0, 0, 0.42); + font-weight: 300; - p { - margin: 0; - font-size: 0.8em - } + p { + margin: 0; + font-size: 0.8em + } } /* Panel */ .panel { - display: flex; - flex-direction: column; - margin: 0.5em; + display: flex; + flex-direction: column; + margin: 0.5em; - background-color: var(--bg); + background-color: $fallback--bg; + background-color: var(--bg, $fallback--bg); - border-radius: 10px; - box-shadow: 1px 1px 4px rgba(0,0,0,.6); - overflow: hidden; + border-radius: 10px; + border-radius: $fallback--panelRadius; + border-radius: var(--panelRadius, 10px); + box-shadow: 1px 1px 4px rgba(0,0,0,.6); + overflow: hidden; } .panel-body:empty::before { - content: "¯\\_(ツ)_/¯"; // Could use words but it'd require translations - display: block; - margin: 1em; - text-align: center; + content: "¯\\_(ツ)_/¯"; // Could use words but it'd require translations + display: block; + margin: 1em; + text-align: center; } .panel-heading { - border-radius: 10px 10px 0 0; - background-size: cover; - padding: 0.6em 1.0em; - text-align: left; - font-size: 1.3em; - line-height: 24px; - background-color: var(--btn); + border-radius: 10px 10px 0 0; + background-size: cover; + padding: 0.6em 1.0em; + text-align: left; + font-size: 1.3em; + line-height: 24px; + background-color: $fallback--btn; + background-color: var(--btn, $fallback--btn); } .panel-footer { - border-radius: 0 0 10px 10px; + border-radius: 0 0 10px 10px; } .panel-body > p { - line-height: 18px; - padding: 1em; - margin: 0; + line-height: 18px; + padding: 1em; + margin: 0; } .container > * { - min-width: 0px; + min-width: 0px; } .fa { - color: grey; + color: grey; } nav { - z-index: 1000; - background-color: var(--bg); - color: var(--faint); - box-shadow: 0px 0px 4px rgba(0,0,0,.6); + z-index: 1000; + background-color: $fallback--btn; + background-color: var(--btn, $fallback--btn); + color: $fallback--faint; + color: var(--faint, $fallback--faint); + box-shadow: 0px 0px 4px rgba(0,0,0,.6); } .fade-enter-active, .fade-leave-active { @@ -259,9 +275,9 @@ nav { } .main { - flex-basis: 60%; - flex-grow: 1; - flex-shrink: 1; + flex-basis: 60%; + flex-grow: 1; + flex-shrink: 1; } .sidebar-bounds { @@ -276,20 +292,20 @@ nav { } .mobile-shown { - display: none; + display: none; } .panel-switcher { - display: none; - width: 100%; - height: 46px; - button { - display: block; - flex: 1; - max-height: 32px; - margin: 0.5em; - padding: 0.5em; - } + display: none; + width: 100%; + height: 46px; + button { + display: block; + flex: 1; + max-height: 32px; + margin: 0.5em; + padding: 0.5em; + } } @media all and (min-width: 960px) { @@ -324,24 +340,24 @@ nav { } @media all and (max-width: 959px) { - .mobile-hidden { - display: none; - } + .mobile-hidden { + display: none; + } - .panel-switcher { - display: flex; - } + .panel-switcher { + display: flex; + } - .container { - padding: 0 0 0 0; - } + .container { + padding: 0 0 0 0; + } - .panel { - margin: 0.5em 0 0.5em 0; - } + .panel { + margin: 0.5em 0 0.5em 0; + } } .item.right { - text-align: right; - padding-right: 20px; + text-align: right; + padding-right: 20px; } diff --git a/src/_variables.scss b/src/_variables.scss index fa7eaec1..eccc0aab 100644 --- a/src/_variables.scss +++ b/src/_variables.scss @@ -1,6 +1,20 @@ $main-color: #f58d2c; $main-background: white; $darkened-background: whitesmoke; -$green_: #0fa00f; -$blue_: #0095ff; -$red_: #ff0000; + +$fallback--bg: #121a24; +$fallback--btn: #182230; +$fallback--faint: #999; +$fallback--fg: #b9b9ba; +$fallback--link: #d8a070; +$fallback--icon: #666; +$fallback--lightBg: rgb(21, 30, 42); +$fallback--lightFg: #b9b9ba; +$fallback--border: #222; +$fallback--cRed: #ff0000; +$fallback--cBlue: #0095ff; +$fallback--cGreen: #0fa00f; +$fallback--cOrange: orange; +$fallback--cYellow: yellow; + +$fallback--panelRadius: 10px; diff --git a/src/components/attachment/attachment.vue b/src/components/attachment/attachment.vue index eeb6e6b8..e3b1e4d4 100644 --- a/src/components/attachment/attachment.vue +++ b/src/components/attachment/attachment.vue @@ -30,6 +30,8 @@ diff --git a/src/components/favorite_button/favorite_button.vue b/src/components/favorite_button/favorite_button.vue index a6e4c46b..f25c589a 100644 --- a/src/components/favorite_button/favorite_button.vue +++ b/src/components/favorite_button/favorite_button.vue @@ -11,18 +11,22 @@ - diff --git a/src/components/login_form/login_form.vue b/src/components/login_form/login_form.vue index 553858a3..82000d6b 100644 --- a/src/components/login_form/login_form.vue +++ b/src/components/login_form/login_form.vue @@ -31,6 +31,7 @@ diff --git a/src/components/notifications/notifications.js b/src/components/notifications/notifications.js index 58d82a09..e55c6e24 100644 --- a/src/components/notifications/notifications.js +++ b/src/components/notifications/notifications.js @@ -24,11 +24,6 @@ const Notifications = { }, unseenCount () { return this.unseenNotifications.length - }, - hiderStyle () { - return { - background: `linear-gradient(to bottom, rgba(0, 0, 0, 0), ${this.$store.state.config.colors.bg} 80%)` - } } }, components: { diff --git a/src/components/notifications/notifications.scss b/src/components/notifications/notifications.scss index a739d52e..5af2454e 100644 --- a/src/components/notifications/notifications.scss +++ b/src/components/notifications/notifications.scss @@ -5,32 +5,39 @@ padding-bottom: 15em; .panel { - background: var(--bg) + background: $fallback--bg; + background: var(--bg, $fallback--bg) } .panel-body { - border-color: var(--border) + border-color: $fallback--border; + border-color: var(--border, $fallback--border) } .panel-heading { // force the text to stay centered, while keeping // the button in the right side of the panel heading position: relative; - background: var(--btn); - color: var(--faint); + background: $fallback--btn; + background: var(--btn, $fallback--btn); + color: $fallback--faint; + color: var(--faint, $fallback--faint); .read-button { position: absolute; right: 0.7em; height: 1.8em; line-height: 100%; - background-color: var(--btn); - color: var(--faint); + background-color: $fallback--btn; + background-color: var(--btn, $fallback--btn); + color: $fallback--faint; + color: var(--faint, $fallback--faint); } } .unseen-count { display: inline-block; - background-color: var(--cRed); + background-color: $fallback--cRed; + background-color: var(--cRed, $fallback--cRed); text-shadow: 0px 0px 3px rgba(0, 0, 0, 0.5); min-width: 1.3em; border-radius: 1.3em; @@ -52,6 +59,10 @@ border-bottom: 1px solid; border-bottom-color: inherit; + .notification-gradient { + background: linear-gradient(to bottom, rgba(0, 0, 0, 0), $fallback--bg 80%); + background: linear-gradient(to bottom, rgba(0, 0, 0, 0), var(--bg, $fallback--bg) 80%) + } .text { min-width: 0px; @@ -61,23 +72,24 @@ overflow: hidden; .icon-retweet.lit { - color: $green_; - color: var(--cGreen); + color: $fallback--cGreen; + color: var(--cGreen, $fallback--cGreen); } .icon-user-plus.lit { - color: $blue_; - color: var(--cBlue); + color: $fallback--cBlue; + color: var(--cBlue, $fallback--cBlue); } .icon-reply.lit { - color: $blue_; - color: var(--cBlue); + color: $fallback--cBlue; + color: var(--cBlue, $fallback--cBlue); } .icon-star.lit { color: orange; - color: var(--cOrange); + color: $fallback--cOrange; + color: var(--cOrange, $fallback--cOrange); } .status-content { @@ -151,7 +163,8 @@ } .unseen { - border-left: 4px solid var(--cRed); + border-left: 4px solid $fallback--cRed; + border-left: 4px solid var(--cRed, $fallback--cRed); padding-left: 6px; } } diff --git a/src/components/notifications/notifications.vue b/src/components/notifications/notifications.vue index 77e29426..17bae71e 100644 --- a/src/components/notifications/notifications.vue +++ b/src/components/notifications/notifications.vue @@ -20,7 +20,7 @@ -
+
@@ -29,7 +29,7 @@ -
+
diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue index 3f268ff5..d57418fb 100644 --- a/src/components/post_status_form/post_status_form.vue +++ b/src/components/post_status_form/post_status_form.vue @@ -50,6 +50,7 @@ diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue index b842c9e9..98f70f7b 100644 --- a/src/components/settings/settings.vue +++ b/src/components/settings/settings.vue @@ -56,6 +56,7 @@ diff --git a/src/components/user_card_content/user_card_content.js b/src/components/user_card_content/user_card_content.js index b7f156d2..2e448f1c 100644 --- a/src/components/user_card_content/user_card_content.js +++ b/src/components/user_card_content/user_card_content.js @@ -15,11 +15,6 @@ export default { } } }, - bodyStyle () { - return { - background: `linear-gradient(to bottom, rgba(0, 0, 0, 0), ${this.$store.state.config.colors.bg} 80%)` - } - }, isOtherUser () { return this.user.id !== this.$store.state.users.currentUser.id }, diff --git a/src/components/user_card_content/user_card_content.vue b/src/components/user_card_content/user_card_content.vue index e3c9b5f9..ca3da632 100644 --- a/src/components/user_card_content/user_card_content.vue +++ b/src/components/user_card_content/user_card_content.vue @@ -70,7 +70,7 @@
-
+
{{ $t('user_card.statuses') }}
@@ -99,19 +99,21 @@ @import '../../_variables.scss'; .profile-panel-background { - background-size: cover; - border-radius: 10px; + background-size: cover; + border-radius: 10px; - .panel-heading { - padding: 0.6em 0em; - text-align: center; - } + .panel-heading { + padding: 0.6em 0em; + text-align: center; + } } .profile-panel-body { - top: -0em; - padding-top: 4em; - word-wrap: break-word; + top: -0em; + padding-top: 4em; + word-wrap: break-word; + background: linear-gradient(to bottom, rgba(0, 0, 0, 0), $fallback--bg 80%); + background: linear-gradient(to bottom, rgba(0, 0, 0, 0), var(--bg, $fallback--bg) 80%) } .user-info { diff --git a/src/components/user_finder/user_finder.vue b/src/components/user_finder/user_finder.vue index 66b2fc87..e4453fe7 100644 --- a/src/components/user_finder/user_finder.vue +++ b/src/components/user_finder/user_finder.vue @@ -16,25 +16,25 @@ diff --git a/src/services/style_setter/style_setter.js b/src/services/style_setter/style_setter.js index 1bd8df51..bedadb12 100644 --- a/src/services/style_setter/style_setter.js +++ b/src/services/style_setter/style_setter.js @@ -47,8 +47,6 @@ const setStyle = (href, commit) => { head.appendChild(styleEl) // const styleSheet = styleEl.sheet - // styleSheet.insertRule(`a { color: ${colors['base08']}`, 'index-max') - // styleSheet.insertRule(`body { color: ${colors['base05']}`, 'index-max') body.style.display = 'initial' } @@ -82,20 +80,14 @@ const setColors = (col, commit) => { colors['base07'] = rgb2hex(col.text.r - mod * 2, col.text.g - mod * 2, col.text.b - mod * 2) colors.link = rgb2hex(col.link.r, col.link.g, col.link.b) // links colors.icon = rgb2hex((col.bg.r + col.text.r) / 2, (col.bg.g + col.text.g) / 2, (col.bg.b + col.text.b) / 2) // icons - colors.cBlue = 'blue' + colors.cBlue = '#0095ff' colors.cRed = 'red' - colors.cGreen = 'green' + colors.cGreen = '#0fa00f' colors.cYellow = 'yellow' colors.cOrange = 'orange' - const colorVars = Object.entries(colors).map(([k, v]) => { - return `--${k}: ${v}` - }) - console.log(colorVars) - - styleSheet.insertRule(`body { ${colorVars.join(';')} }`, 'index-max') - // styleSheet.insertRule(`.base05-border { border-color: ${colors['base05']}`, 'index-max') - // styleSheet.insertRule(`.base03-border { border-color: ${colors['base03']}`, 'index-max') + styleSheet.toString() + styleSheet.insertRule(`body { ${Object.entries(colors).map(([k, v]) => `--${k}: ${v}`).join(';')} }`, 'index-max') body.style.display = 'initial' commit('setOption', { name: 'colors', value: colors }) -- cgit v1.2.3-70-g09d2 From 33b1d85921e326e0d81c4bf1a6fa02fec2cbbd5c Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sun, 1 Apr 2018 22:07:25 +0300 Subject: border-radii moved to variables, made rgbo colors use theme data, customizable from settings screen. --- src/App.scss | 36 +++--- src/_variables.scss | 7 +- src/components/attachment/attachment.vue | 6 +- src/components/chat_panel/chat_panel.vue | 58 +++++---- src/components/login_form/login_form.vue | 10 +- src/components/media_upload/media_upload.vue | 2 +- src/components/notifications/notifications.scss | 2 +- .../post_status_form/post_status_form.vue | 16 ++- src/components/registration/registration.vue | 8 +- src/components/settings/settings.vue | 57 +++++---- src/components/status/status.vue | 10 +- src/components/style_switcher/style_switcher.js | 27 ++++- src/components/style_switcher/style_switcher.vue | 23 +++- src/components/timeline/timeline.vue | 3 - src/components/user_card/user_card.vue | 9 +- .../user_card_content/user_card_content.vue | 134 ++++++++++++++------- src/components/user_finder/user_finder.vue | 4 +- src/components/user_panel/user_panel.vue | 8 +- src/components/user_profile/user_profile.vue | 13 +- src/components/user_settings/user_settings.vue | 36 ++---- src/services/style_setter/style_setter.js | 26 +++- 21 files changed, 308 insertions(+), 187 deletions(-) (limited to 'src/App.scss') diff --git a/src/App.scss b/src/App.scss index ec80626b..a7b56523 100644 --- a/src/App.scss +++ b/src/App.scss @@ -51,7 +51,8 @@ button{ background-color: $fallback--btn; background-color: var(--btn, $fallback--btn); border: none; - border-radius: 5px; + border-radius: $fallback--btnRadius; + border-radius: var(--btnRadius, $fallback--btnRadius); cursor: pointer; border-top: 1px solid rgba(255, 255, 255, 0.2); border-bottom: 1px solid rgba(0, 0, 0, 0.2); @@ -79,7 +80,8 @@ button{ input, textarea, select { border: none; - border-radius: 5px; + border-radius: $fallback--btnRadius; + border-radius: var(--btnRadius, $fallback--btnRadius); border-bottom: 1px solid rgba(255, 255, 255, 0.2); border-top: 1px solid rgba(0, 0, 0, 0.2); box-shadow: 0px 0px 2px black inset; @@ -90,6 +92,7 @@ input, textarea, select { font-family: sans-serif; font-size: 14px; padding: 8px 7px 4px; + box-sizing: border-box; // TODO: Restyle