Change to color customizable

This commit is contained in:
kPherox 2019-04-22 23:59:37 +09:00
parent df9207dfcf
commit e0ed4f30b6
No known key found for this signature in database
GPG Key ID: C04751C2BFA2F62D
2 changed files with 40 additions and 10 deletions

View File

@ -1,5 +1,6 @@
<template> <template>
<div class="welcome"> <div id="welcome">
<img alt="Vue logo" src="@/assets/logo.png">
<h1>Welcome TheDesk</h1> <h1>Welcome TheDesk</h1>
</div> </div>
</template> </template>
@ -8,5 +9,12 @@
import { Component, Prop, Vue } from 'vue-property-decorator' import { Component, Prop, Vue } from 'vue-property-decorator'
@Component @Component
export default class Welcome extends Vue {} export default class Welcome extends Vue {
</script>= }
</script>=
<style lang="postcss">
#welcome {
padding-top: 60px;
}
</style>

View File

@ -1,11 +1,11 @@
<template> <template>
<div id="app"> <div id="app" :style="styles">
<img alt="Vue logo" src="@/assets/logo.png">
<Welcome/> <Welcome/>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { remote } from 'electron'
import { Component, Vue } from 'vue-property-decorator' import { Component, Vue } from 'vue-property-decorator'
import Welcome from '@/components/Welcome.vue' import Welcome from '@/components/Welcome.vue'
@ -14,16 +14,38 @@ import Welcome from '@/components/Welcome.vue'
Welcome, Welcome,
}, },
}) })
export default class App extends Vue { } export default class App extends Vue {
public color: string = '#2c3e50'
public backgroundColor: string = 'white'
public fontSize: string = '16px'
public get styles(): { [key: string]: string } {
return {
'--color': this.color,
'--background-color': this.backgroundColor,
'--font-size': this.fontSize,
}
}
}
</script> </script>
<style> <style>
#app { html {
font-family: "Avenir", Helvetica, Arial, sans-serif; font-family: "Avenir", Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; }
body {
margin: 0;
padding: 0;
width: 100%;
height: 100vh;
}
#app {
color: var(--color);
background-color: var(--background-color);
font-size: var(--font-size);
text-align: center; text-align: center;
color: #2c3e50; height: 100%;
margin-top: 60px;
} }
</style> </style>