Table component further styling

This commit is contained in:
Jonas Heinrich 2020-10-15 22:57:24 +02:00
parent 1d8aa90db6
commit ae0c27bca6
3 changed files with 74 additions and 85 deletions

View File

@ -73,3 +73,15 @@ export default {
}, },
} }
</script> </script>
<style>
.app-navigation-toggle {
display: none;
}
.app-content-vue {
padding-left: 5px;
}
</style>

View File

@ -2,25 +2,19 @@
<table id="table"> <table id="table">
<thead> <thead>
<tr> <tr>
<th id="headerName" class="hidden column-name"> <th />
<div id="headerName-container"> <th class="nameColumn">
<a class="name sort columntitle" data-sort="name"> Name
<span>Name</span>
<span class="sort-indicator" />
</a>
<span id="selectedActionsList" class="selectedActions">
<a href="" class="actions-selected">
<span class="icon icon-more" />
<span>Actions</span>
</a>
</span>
</div>
</th> </th>
<th>Options</th> <th />
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<TableItem /> <TableItem
station-name="SRF Virus"
station-uuid="960b6cd6-0601-11e8-ae97-52543be04c81"
station-isfav="false"
station-img="https://upload.wikimedia.org/wikipedia/commons/thumb/a/ad/Radio_SRF_Virus.svg/205px-Radio_SRF_Virus.svg.png" />
</tbody> </tbody>
</table> </table>
</template> </template>
@ -37,6 +31,7 @@ export default {
</script> </script>
<style lang="scss"> <style lang="scss">
table { table {
position: relative; position: relative;
width: 100%; width: 100%;
@ -44,33 +39,28 @@ table {
display: block; display: block;
flex-direction: column; flex-direction: column;
// FIXME
thead { thead {
position: -webkit-sticky;
position: sticky; position: sticky;
//@include position('sticky');
// header + breadcrumbs
//top: $header-height;
// under breadcrumbs, over file list
z-index: 60; z-index: 60;
display: block; display: block;
background-color: var(--color-main-background-translucent); background-color: var(--color-main-background-translucent);
th {
border-bottom: 1px solid var(--color-border);
padding: 15px;
height: 50px;
}
th.nameColumn {
width: 100%;
padding-left: 35px;
}
} }
tbody { tbody {
display: table; display: table;
width: 100%; width: 100%;
tr {
height: 51px;
background-color: var(--color-background-light);
tr:hover, tr:focus, tr.mouseOver td {
background-color: var(--color-background-hover);
}
}
} }
} }
@ -79,27 +69,6 @@ table th, table th a {
color: var(--color-text-maxcontrast); color: var(--color-text-maxcontrast);
} }
table th .columntitle {
display: block;
padding: 15px;
height: 50px;
box-sizing: border-box;
-moz-box-sizing: border-box;
vertical-align: middle;
}
table th .columntitle.name {
padding-left: 0;
margin-left: 50px;
}
table th,
table td {
border-bottom: 1px solid var(--color-border);
text-align: left;
font-weight: normal;
}
table td { table td {
padding: 0 15px; padding: 0 15px;
font-style: normal; font-style: normal;
@ -107,33 +76,4 @@ table td {
background-repeat: no-repeat; background-repeat: no-repeat;
} }
table th#headerName {
position: relative;
width: 9999px; /* not really sure why this works better than 100% … table styling */
padding: 0;
}
#headerName-container {
position: relative;
height: 50px;
}
table th#headerSize, table td.filesize {
text-align: right;
}
table th#headerDate, table td.date,
table th.column-last, table td.column-last {
-moz-box-sizing: border-box;
box-sizing: border-box;
position: relative;
/* this can not be just width, both need to be set … table styling */
min-width: 130px;
max-width: 130px;
}
#app-content-files thead {
top: 94px;
}
</style> </style>

View File

@ -1,11 +1,11 @@
<template> <template>
<tr> <tr>
<td> <td>
<div class="stationIcon" /> <div class="stationIcon" :style="style" />
</td> </td>
<td class="filenameColumn"> <td class="filenameColumn">
<span class="innernametext"> <span class="innernametext">
SRF Virus {{ stationName }}
</span> </span>
</td> </td>
<td class="actionColumn"> <td class="actionColumn">
@ -31,16 +31,54 @@ export default {
Actions, Actions,
ActionButton, ActionButton,
}, },
props: {
stationName: {
type: String,
required: true,
},
stationIsfav: {
type: Boolean,
default: false,
},
stationUuid: {
type: String,
required: true,
},
stationImg: {
type: String,
default: '',
},
},
computed: {
style() {
return 'background-image: url(' + this.stationImg + ')'
},
},
} }
</script> </script>
<style> <style>
tr {
height: 51px;
background-color: var(--color-background-light);
tr:hover, tr:focus, tr.mouseOver td {
background-color: var(--color-background-hover);
}
}
tr td:first-child { tr td:first-child {
margin-left: 20px; margin-left: 20px;
width: 32px; width: 32px;
padding-right: 0px; padding-right: 0px;
} }
td {
border-bottom: 1px solid var(--color-border);
}
td.filenameColumn .innernametext { td.filenameColumn .innernametext {
color: var(--color-main-text); color: var(--color-main-text);
} }
@ -48,7 +86,6 @@ td.filenameColumn .innernametext {
.stationIcon { .stationIcon {
width: 32px; width: 32px;
height: 32px; height: 32px;
background-image: url('https://upload.wikimedia.org/wikipedia/commons/thumb/a/ad/Radio_SRF_Virus.svg/205px-Radio_SRF_Virus.svg.png');
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: contain; background-size: contain;
background-position: center; background-position: center;