Skip to content

Commit

Permalink
Fix label styling in sidebars
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliusknorr committed Jun 18, 2020
1 parent c64e852 commit bedef5e
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 32 deletions.
76 changes: 46 additions & 30 deletions src/components/board/TagsTabSidebar.vue
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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

0 comments on commit bedef5e

Please sign in to comment.