style: 🎨 stylelint implementation

This commit is contained in:
Fabio 2020-07-31 18:16:28 +02:00
parent 70908eb076
commit 092e8a0732
36 changed files with 2261 additions and 753 deletions

14
.stylelintrc Normal file
View File

@ -0,0 +1,14 @@
{
"extends": [
"stylelint-config-standard"
],
"fix": true,
"formatter": "verbose",
"plugins": [
"stylelint-scss"
],
"rules": {
"at-rule-no-unknown": null
},
"syntax": "scss"
}

1486
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -64,6 +64,9 @@
"eslint-plugin-vue": "^6.2.2",
"node-sass": "^4.14.1",
"sass-loader": "^9.0.2",
"stylelint": "^13.6.1",
"stylelint-config-standard": "^20.0.0",
"stylelint-scss": "^3.18.0",
"vue": "^2.6.11",
"webpack": "^4.44.1"
}

View File

@ -25,7 +25,8 @@ async function createMainWindow () {
webPreferences: {
nodeIntegration: true,
'web-security': false,
enableRemoteModule: true
enableRemoteModule: true,
spellcheck: false
},
frame: false,
backgroundColor: '#1d1d1d'

View File

@ -83,7 +83,7 @@ export default {
</script>
<style scoped>
.modal.modal-sm .modal-container{
.modal.modal-sm .modal-container {
padding: 0;
}
</style>

View File

@ -38,9 +38,8 @@ export default {
</script>
<style lang="scss">
.context{
.context {
display: flex;
position: absolute;
color: $body-font-color;
font-size: 16px;
z-index: 400;
@ -55,11 +54,11 @@ export default {
bottom: 0;
pointer-events: none;
.context-container{
.context-container {
min-width: 100px;
max-width: 150px;
z-index: 1;
box-shadow: 0px 0px 1px 0px #000;
box-shadow: 0 0 1px 0 #000;
padding: 0;
background: #1d1d1d;
border-radius: 0.1rem;
@ -68,19 +67,19 @@ export default {
position: absolute;
pointer-events: initial;
.context-element{
.context-element {
display: flex;
align-items: center;
padding: .1rem .3rem;
padding: 0.1rem 0.3rem;
cursor: pointer;
&:hover{
&:hover {
background: $primary-color;
}
}
}
.context-overlay{
.context-overlay {
background: transparent;
bottom: 0;
cursor: default;

View File

@ -71,7 +71,7 @@ export default {
};
</script>
<style scoped>
.toast{
.toast {
display: flex;
justify-content: space-between;
user-select: text;
@ -80,7 +80,7 @@ export default {
margin-left: auto;
}
.notification-message{
.notification-message {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
@ -88,7 +88,7 @@ export default {
max-width: 30rem;
}
.expanded .notification-message{
.expanded .notification-message {
white-space: initial;
}
</style>

View File

@ -70,7 +70,7 @@ export default {
};
</script>
<style scoped>
.toast{
.toast {
display: flex;
justify-content: space-between;
user-select: text;

View File

@ -71,7 +71,3 @@ export default {
}
};
</script>
<style>
</style>

View File

@ -230,7 +230,7 @@ export default {
</script>
<style scoped>
.modal-container{
.modal-container {
max-width: 450px;
}
</style>

View File

@ -253,7 +253,7 @@ export default {
</script>
<style scoped>
.modal-container{
.modal-container {
max-width: 450px;
}
</style>

View File

@ -182,24 +182,23 @@ export default {
</script>
<style lang="scss">
#settings{
.modal-body{
#settings {
.modal-body {
overflow: hidden;
.panel-body{
.panel-body {
height: calc(70vh - 70px);
overflow: auto;
}
.badge::after{
.badge::after {
background: #32b643;
}
.form-label{
.form-label {
display: flex;
align-items: center;
}
}
}
</style>

View File

@ -78,7 +78,7 @@ export default {
</script>
<style lang="scss">
.empty{
.empty {
color: $body-font-color;
}
</style>

View File

@ -69,21 +69,20 @@ export default {
</script>
<style lang="scss">
.editor-wrapper{
border-bottom: 1px solid #444444;
.editor-wrapper {
border-bottom: 1px solid #444;
}
.CodeMirror{
.CodeMirror {
height: 200px;
.CodeMirror-scroll{
.CodeMirror-scroll {
max-width: 100%;
}
.CodeMirror-line {
word-break: break-word!important;
white-space: pre-wrap!important;
word-break: normal;
word-break: break-word !important;
white-space: pre-wrap !important;
}
}
</style>

View File

@ -69,7 +69,3 @@ export default {
}
};
</script>
<style>
</style>

View File

@ -26,7 +26,7 @@ export default {
</script>
<style scoped>
.empty{
.empty {
height: 100%;
border-radius: 0;
background: transparent;

View File

@ -50,38 +50,38 @@ export default {
</script>
<style lang="scss">
#footer{
#footer {
height: $footer-height;
display: flex;
justify-content: space-between;
align-items: center;
background: $primary-color;
padding: 0 .2rem;
padding: 0 0.2rem;
position: fixed;
bottom: 0;
left: 0;
right: 0;
box-shadow: 0 0 1px 0px #000;
box-shadow: 0 0 1px 0 #000;
.footer-elements{
.footer-elements {
list-style: none;
margin: 0;
display: flex;
align-items: center;
.footer-element{
.footer-element {
height: $footer-height;
display: flex;
align-items: center;
padding: 0 .4rem;
padding: 0 0.4rem;
margin: 0;
&.footer-link{
&.footer-link {
cursor: pointer;
transition: background .2s;
transition: background 0.2s;
&:hover{
background: rgba($color: #fff, $alpha: .1);
&:hover {
background: rgba($color: #fff, $alpha: 0.1);
}
}
}

View File

@ -75,7 +75,7 @@ export default {
</script>
<style lang="scss">
#notifications-board{
#notifications-board {
position: absolute;
z-index: 9;
right: 1rem;

View File

@ -106,7 +106,7 @@ export default {
</script>
<style lang="scss">
#settingbar{
#settingbar {
width: $settingbar-width;
height: calc(100vh - #{$excluding-size});
display: flex;
@ -115,10 +115,10 @@ export default {
align-items: center;
background: $bg-color-light;
padding: 0;
box-shadow: 0 0 1px 0px #000;
box-shadow: 0 0 1px 0 #000;
z-index: 9;
.settingbar-top-elements{
.settingbar-top-elements {
overflow-x: hidden;
overflow-y: overlay;
max-height: calc((100vh - 3.5rem) - #{$excluding-size});
@ -128,43 +128,42 @@ export default {
}
}
.settingbar-bottom-elements{
padding-top: .5rem;
.settingbar-bottom-elements {
padding-top: 0.5rem;
background: $bg-color-light;
z-index: 1;
}
.settingbar-elements{
.settingbar-elements {
list-style: none;
text-align: center;
width: $settingbar-width;
padding: 0;
margin: 0;
.settingbar-element{
.settingbar-element {
height: $settingbar-width;
width: 100%;
margin: 0;
border-left: 3px solid transparent;
opacity: .5;
transition: opacity .2s;
opacity: 0.5;
transition: opacity 0.2s;
display: flex;
align-content: center;
justify-content: center;
flex-direction: column;
&:hover{
&:hover {
opacity: 1;
}
&.selected{
&.selected {
border-left-color: $body-font-color;
opacity: 1;
}
.settingbar-element-icon{
&.badge::after{
.settingbar-element-icon {
&.badge::after {
bottom: -10px;
right: 0;
position: absolute;
@ -172,33 +171,31 @@ export default {
}
}
}
}
}
.ex-tooltip{// Because both overflow-x: visible and overflow-y:auto are evil!!!
.ex-tooltip-content{
.ex-tooltip {// Because both overflow-x: visible and overflow-y:auto are evil!!!
.ex-tooltip-content {
z-index: 999;
visibility: hidden;
opacity: 0;
display:block;
position:absolute;
background-color:#feffe1;
display: block;
position: absolute;
text-align: center;
margin:.0 0 0 calc(#{$settingbar-width} - 5px);
margin: 0 0 0 calc(#{$settingbar-width} - 5px);
left: 0;
padding: .2rem .4rem;
font-size: .7rem;
background: rgba(48,55,66,.95);
border-radius: .1rem;
padding: 0.2rem 0.4rem;
font-size: 0.7rem;
background: rgba(48, 55, 66, 0.95);
border-radius: 0.1rem;
color: #fff;
max-width: 320px;
pointer-events: none;
text-overflow: ellipsis;
transition: opacity .2s;
transition: opacity 0.2s;
}
&:hover .ex-tooltip-content{
&:hover .ex-tooltip-content {
visibility: visible;
opacity: 1;
}

View File

@ -81,7 +81,7 @@ export default {
</script>
<style lang="scss">
#titlebar{
#titlebar {
display: flex;
position: relative;
justify-content: space-between;
@ -90,10 +90,10 @@ export default {
height: $titlebar-height;
-webkit-app-region: drag;
user-select: none;
box-shadow: 0 0 1px 0px #000;
box-shadow: 0 0 1px 0 #000;
z-index: 9999;
.titlebar-resizer{
.titlebar-resizer {
position: absolute;
top: 0;
width: 100%;
@ -102,31 +102,31 @@ export default {
-webkit-app-region: no-drag;
}
.titlebar-elements{
.titlebar-elements {
display: flex;
align-items: center;
.titlebar-logo{
.titlebar-logo {
height: $titlebar-height;
padding: 0 .4rem;
padding: 0 0.4rem;
}
.titlebar-element{
.titlebar-element {
display: flex;
align-items: center;
height: $titlebar-height;
line-height: 0;
padding: 0 .7rem;
opacity: .7;
transition: opacity .2s;
padding: 0 0.7rem;
opacity: 0.7;
transition: opacity 0.2s;
-webkit-app-region: no-drag;
&:hover{
&:hover {
opacity: 1;
background: rgba($color: #fff, $alpha: .2);
background: rgba($color: #fff, $alpha: 0.2);
}
&.close-button:hover{
&.close-button:hover {
background: red;
}
}

View File

@ -92,37 +92,37 @@ export default {
</script>
<style lang="scss">
.workspace{
.workspace {
padding: 0;
margin: 0;
.workspace-tabs{
.workspace-tabs {
overflow: auto;
height: calc(100vh - #{$excluding-size});
.tab-block{
.tab-block {
background: $bg-color-light;
margin-top: 0;
.tab-item{
.tab-item {
max-width: 12rem;
width: fit-content;
flex: initial;
&.active a{
&.active a {
opacity: 1;
}
> a{
padding: .2rem .8rem;
> a {
padding: 0.2rem 0.8rem;
color: $body-font-color;
cursor: pointer;
display: flex;
align-items: center;
opacity: .7;
transition: opacity .2s;
opacity: 0.7;
transition: opacity 0.2s;
&:hover{
&:hover {
opacity: 1;
}
@ -136,15 +136,15 @@ export default {
}
}
.workspace-query-results{
.workspace-query-results {
overflow: auto;
white-space: nowrap;
.table{
.table {
width: auto;
border-collapse: separate;
.th{
.th {
position: sticky;
top: 0;
background: $bg-color;
@ -154,28 +154,28 @@ export default {
border-color: $bg-color-light;
padding: 0;
font-weight: 700;
font-size: .7rem;
font-size: 0.7rem;
> div {
padding: .1rem .4rem;
padding: 0.1rem 0.4rem;
min-width: -webkit-fill-available;
}
}
.td{
.td {
border-right: 1px solid;
border-bottom: 1px solid;
border-color: $bg-color-light;
padding: 0 .4rem;
padding: 0 0.4rem;
text-overflow: ellipsis;
max-width: 200px;
white-space: nowrap;
overflow: hidden;
font-size: .7rem;
font-size: 0.7rem;
&:focus{
box-shadow:inset 0px 0px 0px 1px $body-font-color;
background: rgba($color: #000000, $alpha: .3);
&:focus {
box-shadow: inset 0 0 0 1px $body-font-color;
background: rgba($color: #000, $alpha: 0.3);
outline: none;
}
}

View File

@ -72,7 +72,7 @@ export default {
</script>
<style scoped>
.empty{
.empty {
height: 100%;
border-radius: 0;
background: transparent;

View File

@ -123,7 +123,7 @@ export default {
</script>
<style lang="scss">
.workspace-explorebar-resizer{
.workspace-explorebar-resizer {
position: absolute;
width: 4px;
right: -2px;
@ -133,7 +133,7 @@ export default {
z-index: 99;
}
.workspace-explorebar{
.workspace-explorebar {
width: $explorebar-width;
display: flex;
flex-direction: column;
@ -141,22 +141,22 @@ export default {
align-items: center;
text-align: left;
background: $bg-color-gray;
box-shadow: 0 0 1px 0px #000;
box-shadow: 0 0 1px 0 #000;
z-index: 8;
flex: initial;
position: relative;
padding: 0;
.workspace-explorebar-header{
.workspace-explorebar-header {
width: 100%;
padding: .3rem;
padding: 0.3rem;
display: flex;
justify-content: space-between;
font-size: .6rem;
font-size: 0.6rem;
font-weight: 700;
text-transform: uppercase;
.workspace-explorebar-title{
.workspace-explorebar-title {
width: 80%;
white-space: nowrap;
overflow: hidden;
@ -169,24 +169,24 @@ export default {
display: flex;
align-items: center;
> i{
opacity: .6;
transition: opacity .2s;
> i {
opacity: 0.6;
transition: opacity 0.2s;
display: flex;
align-items: center;
&:hover{
&:hover {
opacity: 1;
}
}
}
}
.workspace-explorebar-body{
.workspace-explorebar-body {
width: 100%;
height: calc((100vh - 30px) - #{$excluding-size});
overflow: overlay;
padding: 0 .1rem;
padding: 0 0.1rem;
}
}
</style>

View File

@ -56,34 +56,34 @@ export default {
</script>
<style lang="scss">
.workspace-explorebar-database{
.workspace-explorebar-database {
.database-name,
a.table-name{
a.table-name {
display: flex;
align-items: center;
padding: .1rem;
padding: 0.1rem;
cursor: pointer;
font-size: .7rem;
font-size: 0.7rem;
> span{
> span {
overflow: hidden;
white-space: nowrap;
display: block;
text-overflow: ellipsis;
}
&:hover{
&:hover {
color: $body-font-color;
background: rgba($color: #FFF, $alpha: .05);
background: rgba($color: #fff, $alpha: 0.05);
border-radius: 2px;
}
}
.menu-item{
.menu-item {
line-height: 1.2;
}
.database-tables{
.database-tables {
margin-left: 1.2rem;
}
}

View File

@ -149,33 +149,32 @@ export default {
</script>
<style lang="scss">
.workspace-tabs{
.workspace-tabs {
align-content: baseline;
.workspace-query-runner{
.workspace-query-runner-footer{
.workspace-query-runner {
.workspace-query-runner-footer {
display: flex;
justify-content: space-between;
padding: .3rem .6rem .4rem;
padding: 0.3rem 0.6rem 0.4rem;
align-items: center;
.workspace-query-buttons{
.workspace-query-buttons {
display: flex;
.btn{
.btn {
display: flex;
align-self: center;
color: $body-font-color;
margin-right: .4rem;
margin-right: 0.4rem;
}
}
.workspace-query-info{
.workspace-query-info {
display: flex;
> div + div{
padding-left: .6rem;
> div + div {
padding-left: 0.6rem;
}
}
}

View File

@ -274,40 +274,40 @@ export default {
overflow-anchor: none;
}
.column-resizable{
.column-resizable {
&:hover,
&:active{
&:active {
resize: horizontal;
overflow: hidden;
}
}
.table-column-title{
.table-column-title {
display: flex;
align-items: center;
}
.sort-icon{
font-size: .7rem;
.sort-icon {
font-size: 0.7rem;
line-height: 1;
margin-left: .2rem;
margin-left: 0.2rem;
}
.column-key{
.column-key {
transform: rotate(90deg);
font-size: .7rem;
font-size: 0.7rem;
line-height: 1.5;
margin-right: .2rem;
margin-right: 0.2rem;
&.key-pri{
&.key-pri {
color: goldenrod;
}
&.key-uni{
&.key-uni {
color: deepskyblue;
}
&.key-mul{
&.key-mul {
color: palegreen;
}
}

View File

@ -205,27 +205,27 @@ export default {
</script>
<style lang="scss">
.editable-field{
.editable-field {
margin: 0;
border: none;
line-height: 1;
width: 100%;
}
.cell-content{
.cell-content {
display: block;
min-height: .8rem;
min-height: 0.8rem;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.textarea-editor{
height: 50vh!important;
.textarea-editor {
height: 50vh !important;
}
.editor-field-info{
margin-top: .6rem;
.editor-field-info {
margin-top: 0.6rem;
display: flex;
justify-content: space-between;
}

View File

@ -67,7 +67,3 @@ export default {
}
};
</script>
<style>
</style>

View File

@ -146,33 +146,32 @@ export default {
</script>
<style lang="scss">
.workspace-tabs{
.workspace-tabs {
align-content: baseline;
.workspace-query-runner{
.workspace-query-runner-footer{
.workspace-query-runner {
.workspace-query-runner-footer {
display: flex;
justify-content: space-between;
padding: .3rem .6rem .4rem;
padding: 0.3rem 0.6rem 0.4rem;
align-items: center;
.workspace-query-buttons{
.workspace-query-buttons {
display: flex;
.btn{
.btn {
display: flex;
align-self: center;
color: $body-font-color;
margin-right: .4rem;
margin-right: 0.4rem;
}
}
.workspace-query-info{
.workspace-query-info {
display: flex;
> div + div{
padding-left: .6rem;
> div + div {
padding-left: 0.6rem;
}
}
}

View File

@ -5,12 +5,35 @@
display: table;
table-layout: fixed;
&.table-striped {
.tbody {
.tr:nth-of-type(odd) {
background: $bg-color;
display: table-row-group;
}
.tr {
display: table-row;
}
// Scollable tables
&.table-scroll {
display: block;
overflow-x: auto;
padding-bottom: 0.75rem;
white-space: nowrap;
}
.thead {
display: table-header-group;
}
.td,
.th {
border-bottom: $border-width solid $border-color;
padding: $unit-3 $unit-2;
display: table-cell;
}
.th {
border-bottom-width: $border-width-lg;
}
&,
@ -20,6 +43,7 @@
&.selected {
background: #333 !important;
}
&.active {
background: $bg-color-dark;
}
@ -37,33 +61,11 @@
}
}
// Scollable tables
&.table-scroll {
display: block;
overflow-x: auto;
padding-bottom: 0.75rem;
white-space: nowrap;
}
.thead {
display: table-header-group;
}
&.table-striped {
.tbody {
display: table-row-group;
.tr:nth-of-type(odd) {
background: $bg-color;
}
.tr {
display: table-row;
}
.td,
.th {
border-bottom: $border-width solid $border-color;
padding: $unit-3 $unit-2;
display: table-cell;
}
.th {
border-bottom-width: $border-width-lg;
}
}

View File

@ -1,16 +1,38 @@
.material-icons {
// TODO: rewrite with rem
.material-icons{// TODO: rewrite with rem
/* Rules for sizing the icon. */
&.md-18 { font-size: 18px; }
&.md-24 { font-size: 24px; }
&.md-36 { font-size: 36px; }
&.md-48 { font-size: 48px; }
&.md-18 {
font-size: 18px;
}
&.md-24 {
font-size: 24px;
}
&.md-36 {
font-size: 36px;
}
&.md-48 {
font-size: 48px;
}
/* Rules for using icons as black on a light background. */
&.md-dark { color: rgba(0, 0, 0, 0.54); }
&.md-dark.md-inactive { color: rgba(0, 0, 0, 0.26); }
&.md-dark {
color: rgba(0, 0, 0, 0.54);
}
&.md-dark.md-inactive {
color: rgba(0, 0, 0, 0.26);
}
/* Rules for using icons as white on a dark background. */
&.md-light { color: rgba(255, 255, 255, 1); }
&.md-light.md-inactive { color: rgba(255, 255, 255, 0.3); }
&.md-light {
color: rgba(255, 255, 255, 1);
}
&.md-light.md-inactive {
color: rgba(255, 255, 255, 0.3);
}
}

View File

@ -1,9 +1,11 @@
.slide-fade-enter-active {
transition: all 0.3s ease;
}
.slide-fade-leave-active {
transition: all 0.3s cubic-bezier(1, 0.5, 0.8, 1);
}
.slide-fade-enter,
.slide-fade-leave-to {
transform: translateX(10px);

View File

@ -1,4 +1,4 @@
/*Colors*/
/* Colors */
$body-bg: #1d1d1d;
$body-font-color: #fff;
$bg-color: #1d1d1d;
@ -9,7 +9,7 @@ $success-color: #32b643;
$error-color: #de3b28;
$warning-color: #e0a40c;
/*Sizes*/
/* Sizes */
$titlebar-height: 1.5rem;
$settingbar-width: 3rem;
$explorebar-width: 14rem;

View File

@ -12,7 +12,7 @@ body {
user-select: none;
}
/*Additions*/
/* Additions */
@include margin-variant(3, $unit-3);
@include margin-variant(4, $unit-4);
@include padding-variant(3, $unit-3);
@ -59,6 +59,7 @@ body {
from {
transform: rotate(0deg);
}
to {
transform: rotate(359deg);
}
@ -68,16 +69,16 @@ body {
animation: rotation 0.8s infinite linear;
}
/*Override*/
/* Override */
.modal {
.modal-overlay,
&.active .modal-overlay {
background: rgba(255, 255, 255, 0.15);
}
.modal-sm .modal-container,
.modal-container {
box-shadow: 0 0 1px 0px #000;
.modal-container,
.modal-sm .modal-container {
box-shadow: 0 0 1px 0 #000;
padding: 0;
background: $bg-color;
@ -127,12 +128,13 @@ body {
border-color: $primary-color;
}
.input-group .input-group-addon{
.input-group .input-group-addon {
border-color: #3f3f3f;
}
.menu {
font-size: 0.7rem;
.menu-item {
+ .menu-item {
margin-top: 0;