Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve label styling #2045

Merged
merged 2 commits into from Jun 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
76 changes: 46 additions & 30 deletions src/components/board/TagsTabSidebar.vue
Expand Up @@ -14,24 +14,30 @@
type="submit"
value=""
class="icon-confirm">
<input v-tooltip="t('deck', 'Cancel')"
value=""
class="icon-close"
@click="editingLabelId = null">
<Actions>
<ActionButton v-tooltip="{content: missingDataLabel, show: !editLabelObjValidated, trigger: 'manual' }"
:disabled="!editLabelObjValidated"
icon="icon-close"
@click="editingLabelId = null">
{{ t('deck', 'Cancel') }}
</ActionButton>
</Actions>
</form>
</template>
<template v-else>
<div :style="{ backgroundColor: `#${label.color}`, color:textColor(label.color) }" class="label-title">
<span>{{ label.title }}</span>
<div class="label-title" @click="clickEdit(label)">
<span :style="{ backgroundColor: `#${label.color}`, color: textColor(label.color) }">{{ label.title }}</span>
</div>
<button v-if="canManage && !isArchived"
v-tooltip="t('deck', 'Edit')"
class="icon-rename"
@click="clickEdit(label)" />
<button v-if="canManage && !isArchived"
v-tooltip="t('deck', 'Delete')"
class="icon-delete"
@click="deleteLabel(label.id)" />
<Actions v-if="canManage && !isArchived">
<ActionButton icon="icon-rename" @click="clickEdit(label)">
{{ t('deck', 'Edit') }}
</ActionButton>
</Actions>
<Actions v-if="canManage && !isArchived">
<ActionButton icon="icon-delete" @click="deleteLabel(label.id)">
{{ t('deck', 'Delete') }}
</ActionButton>
</Actions>
</template>
</li>

Expand All @@ -48,10 +54,11 @@
type="submit"
value=""
class="icon-confirm">
<input v-tooltip="t('deck', 'Cancel')"
value=""
class="icon-close"
@click="addLabel=false">
<Actions>
<ActionButton icon="icon-close" @click="addLabel=false">
{{ t('deck', 'Cancel') }}
</ActionButton>
</Actions>
</form>
</template>
</li>
Expand All @@ -66,12 +73,14 @@

import { mapGetters } from 'vuex'
import Color from '../../mixins/color'
import { ColorPicker } from '@nextcloud/vue'
import { ColorPicker, Actions, ActionButton } from '@nextcloud/vue'

export default {
name: 'TagsTabSidebar',
components: {
ColorPicker,
Actions,
ActionButton,
},
mixins: [Color],
data() {
Expand Down Expand Up @@ -149,20 +158,31 @@ export default {
}
</script>
<style scoped lang="scss">
$clickable-area: 37px;
$clickable-area: 44px;

.labels li {
display: flex;
margin-bottom: 3px;
align-items: stretch;
height: $clickable-area;

&:hover {
background-color: var(--color-background-hover);
border-radius: 3px;
}

.label-title {
flex-grow: 1;
border-radius: 3px;
padding: 7px;
padding: 10px;

&:hover, span:hover {
cursor: pointer;
}

span {
vertical-align: middle;
border-radius: 15px;
padding: 7px 12px;
}
}
&:not(.editing) button {
Expand Down Expand Up @@ -195,15 +215,11 @@ export default {
display: flex;
input[type=text] {
flex-grow: 1;
margin: 5px;
}
input[type=submit] {
margin-top: 5px;
}
}
button,
input:not([type='text']):last-child {
min-width: $clickable-area;
border-radius: 0 var(--border-radius) var(--border-radius) 0;
margin-left: -1px;
width: 35px;
background-color: var(--color-main-background);
}
}
</style>
4 changes: 2 additions & 2 deletions src/components/card/CardSidebar.vue
Expand Up @@ -588,8 +588,8 @@ export default {
flex-grow: 0;
flex-shrink: 1;
overflow: hidden;
padding: 1px 3px;
border-radius: 3px;
padding: 0px 5px;
border-radius: 15px;
font-size: 85%;
margin-right: 3px;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/cards/CardItem.vue
Expand Up @@ -229,7 +229,7 @@ export default {
display: flex;
flex-direction: row;
overflow: hidden;
padding: 3px 7px;
padding: 0px 5px;
border-radius: 15px;
font-size: 85%;
margin-right: 3px;
Expand Down