summaryrefslogtreecommitdiffstats
path: root/apps/files/src/mixins/fileslist-row.scss
blob: 06b6637b6f2da10ef7f92ff929f53bfbf701a7de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/**
 * @copyright Copyright (c) 2023 John Molakvoæ <skjnldsv@protonmail.com>
 *
 * @author John Molakvoæ <skjnldsv@protonmail.com>
 *
 * @license AGPL-3.0-or-later
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 *
 */

/**
 * This file is for every column styling that must be
 * shared between the files list and the list header.
 */
td, th {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
	justify-content: left;
	width: var(--row-height);
	height: var(--row-height);
	margin: 0;
	padding: 0;
	color: var(--color-text-maxcontrast);
	border: none;

	// Columns should try to add any text
	// node wrapped in a span. That should help
	// with the ellipsis on overflow.
	span {
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
	}
}

.files-list__row-checkbox {
	justify-content: center;
	&::v-deep .checkbox-radio-switch {
		display: flex;
		justify-content: center;

		--icon-size: var(--checkbox-size);

		label.checkbox-radio-switch__label {
			width: var(--clickable-area);
			height: var(--clickable-area);
			margin: 0;
			padding: calc((var(--clickable-area) - var(--checkbox-size)) / 2);
		}

		.checkbox-radio-switch__icon {
			margin: 0 !important;
		}
	}
}

.files-list__row-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--icon-preview-size);
	height: 100%;
	// Show same padding as the checkbox right padding for visual balance
	margin-right: var(--checkbox-padding);
	color: var(--color-primary-element);

	& > span {
		justify-content: flex-start;
	}

	&::v-deep svg {
		width: var(--icon-preview-size);
		height: var(--icon-preview-size);
	}

	&-preview {
		overflow: hidden;
		width: var(--icon-preview-size);
		height: var(--icon-preview-size);
		border-radius: var(--border-radius);
		background-repeat: no-repeat;
		// Center and contain the preview
		background-position: center;
		background-size: contain;
	}
}

.files-list__row-name {
	// Prevent link from overflowing
	overflow: hidden;
	// Take as much space as possible
	flex: 1 1 auto;

	a {
		display: flex;
		align-items: center;
		// Fill cell height and width
		width: 100%;
		height: 100%;
	}
}

.files-list__row-actions {
	width: auto;

	& ~ td,
	& ~ th {
		// Add margin to all cells after the actions
		margin: 0 var(--cell-margin);
	}
}

.files-list__row-size {
	// Right align text
	justify-content: flex-end;
	width: calc(var(--row-height) * 1.5);
	// opacity varies with the size
	color: var(--color-main-text);

	// Icon is before text since size is right aligned
	::v-deep .files-list__column-sort-button {
		padding: 0 16px 0 4px !important;
		.button-vue__wrapper {
			flex-direction: row;
		}
	}
}

.files-list__row-column-custom {
	width: calc(var(--row-height) * 2);
}