simplify css

This commit is contained in:
Víctor Losada Hernández
2026-09-12 14:52:37 +02:00
parent 3f7516f9a1
commit 467e5ee87f
@@ -1,13 +1,15 @@
@import '@sharedStyles/core.less'; @import '@sharedStyles/core.less';
@import '@themes/assets/assets.less'; @import '@themes/assets/assets.less';
@import url('https://fonts.googleapis.com/css2?family=Alata&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Alata&display=swap');
.brewItem { .brewItem {
display:flex;
flex-direction : column;
position : relative; position : relative;
overflow : hidden; overflow : hidden;
font-size : 15px; font-size : 15px;
break-inside : avoid; break-inside : avoid;
-webkit-column-break-inside : avoid; -webkit-column-break-inside : avoid;
isolation : isolate;
.thumbnail { .thumbnail {
position : absolute; position : absolute;
top : 0; top : 0;
@@ -45,13 +47,11 @@
font-family : 'Font Awesome 6 Free'; font-family : 'Font Awesome 6 Free';
font-size : 12px; font-size : 12px;
} }
--tag-base : #C8AC6E; --tag-base : #C8AC6E;
--tag-type : #008000; --tag-type : #008000;
--tag-group : #000000; --tag-group : #000000;
--tag-meta : #000080; --tag-meta : #000080;
--tag-system : #800000; --tag-system : #800000;
&.type { &.type {
color : var(--tag-type); color : var(--tag-type);
background-color : rgba(from var(--tag-type) r g b / 0.231); background-color : rgba(from var(--tag-type) r g b / 0.231);
@@ -91,18 +91,19 @@
button { button {
display : block; display : block;
width : 100%; width : 100%;
font-size : 1.3em; font-size : 1.3em;
color : white; color : white;
text-decoration : unset; text-decoration : unset;
align-content : center;
height : 100%;
text-align : center;
i { cursor : pointer; } i { cursor : pointer; }
} }
} }
} }
.grid > .brewItem { .grid > .brewItem {
display : flex;
flex-direction : column;
justify-content : space-between; justify-content : space-between;
width : clamp(300px, 48%, 500px); width : clamp(300px, 48%, 500px);
min-height : 125px; min-height : 125px;
@@ -162,7 +163,6 @@
} }
} }
} }
.list > .brewItem { .list > .brewItem {
display : grid; display : grid;
grid-template-columns : 35% 3fr 150px; grid-template-columns : 35% 3fr 150px;
@@ -170,25 +170,21 @@
align-items : center; align-items : center;
width : 100%; width : 100%;
height : 50px; height : 50px;
color : #000000; color : white;
background : #EEEEEE; background : #666;
.thumbnail { display:none; }
.text { .text {
padding-left : 10px; padding-left : 10px;
h2 { h2 {
align-content : center; align-content : center;
min-height : 1.4em; min-height : 1.4em;
overflow : hidden; overflow : hidden;
text-overflow : ellipsis; text-overflow : ellipsis;
font-weight : 900;
vertical-align : middle; vertical-align : middle;
white-space : nowrap; white-space : nowrap;
} }
.description { display : none; } .description { display : none; }
} }
.info { .info {
display : grid; display : grid;
grid-template-areas : 'tags authors pages views update storage'; grid-template-areas : 'tags authors pages views update storage';
@@ -202,7 +198,6 @@
display : inline-block; display : inline-block;
grid-area : tags; grid-area : tags;
min-width : 100px; min-width : 100px;
span { span {
--tag-base : #AE9913; --tag-base : #AE9913;
--tag-type : #3D843D; --tag-type : #3D843D;
@@ -210,7 +205,6 @@
--tag-meta : #5050B1; --tag-meta : #5050B1;
--tag-system : #C55656; --tag-system : #C55656;
} }
} }
.brewAuthors { .brewAuthors {
display : -webkit-box; display : -webkit-box;
@@ -223,10 +217,8 @@
-webkit-line-clamp : 3; -webkit-line-clamp : 3;
line-clamp : 3; line-clamp : 3;
-webkit-box-orient : vertical; -webkit-box-orient : vertical;
&:has(a:only-of-type) { width : fit-content; } &:has(a:only-of-type) { width : fit-content; }
} }
.lastViewed { .lastViewed {
display : inline-block; display : inline-block;
grid-area : views; grid-area : views;
@@ -246,15 +238,12 @@
grid-area : storage; grid-area : storage;
filter : drop-shadow(0 0 10px white); filter : drop-shadow(0 0 10px white);
} }
.brewTags:has(span:nth-of-type(4)) { .brewTags:has(span:nth-of-type(4)) {
position : relative; position : relative;
display : flex; display : flex;
flex-wrap : wrap; flex-wrap : wrap;
overflow : hidden; overflow : hidden;
span:nth-of-type(n + 2) { display : none; } span:nth-of-type(n + 2) { display : none; }
&:hover { &:hover {
position : absolute; position : absolute;
top : 0; top : 0;
@@ -264,9 +253,7 @@
padding : 10px; padding : 10px;
overflow : visible; overflow : visible;
background : #707070; background : #707070;
span:nth-of-type(n + 4) { display : block; } span:nth-of-type(n + 4) { display : block; }
&::after { &::after {
position : absolute; position : absolute;
top : 48px; top : 48px;
@@ -286,40 +273,32 @@
} }
} }
} }
.links { .links {
position : relative; position : relative;
display : flex; display : flex;
align-items : center; align-items : center;
justify-content : space-evenly; justify-content : space-evenly;
height : 100%; height : 100%;
a, button { a, button {
align-content : center; align-content : center;
height : 100%; height : 100%;
text-align : center; text-align : center;
&:hover { background-color : hsl(from currentColor h 30% 90%); } &:hover { background-color : hsl(from currentColor h 30% 90%); }
} }
.shareLink { color : @yellow; } .shareLink { color : @yellow; }
.editLink { color : @green; } .editLink { color : @green; }
.downloadLink { color : @blueLight; } .downloadLink { color : @blueLight; }
.deleteLink { color : @red; } .deleteLink { color : @red; }
} }
} }
.card > .brewItem { .card > .brewItem {
display : flex;
flex-direction : column;
gap : 5px; gap : 5px;
justify-content : flex-end; justify-content : flex-end;
width : 300px; width : 300px;
height : 400px; height : 400px;
padding : 10px; padding : 100px 10px 50px;
padding-top : 100px;
padding-bottom : 50px;
color : white; color : white;
background-color : grey; background-color : #555;
background-image : url('@themes/assets/naturalCritLogoBlack.svg'); background-image : url('@themes/assets/naturalCritLogoBlack.svg');
background-repeat : no-repeat; background-repeat : no-repeat;
background-position : center 20%; background-position : center 20%;
@@ -327,8 +306,6 @@
border : 1px solid; border : 1px solid;
border-radius : 10px; border-radius : 10px;
background-blend-mode : soft-light; background-blend-mode : soft-light;
isolation : isolate;
&::before { &::before {
position : absolute; position : absolute;
right : 0; right : 0;
@@ -338,18 +315,16 @@
display : block; display : block;
height : 50%; height : 50%;
content : ''; content : '';
background-image : linear-gradient(0deg, #777777FF 0, #77777700 90%); background-image : linear-gradient(0deg, #555F 0, #5550 90%);
transition : height 0.2s; transition : height 0.2s;
} }
&:hover { &:hover {
&::before { &::before {
height : 100%; height : 100%;
background-image : linear-gradient(0deg, #777777FF 0, #777777FF 55%, #77777700 65%); background-image : linear-gradient(0deg, #555F 0, #555F 55%, #5550 65%);
} }
.text .description { height : fit-content; } .text .description { height : fit-content; }
} }
.thumbnail { .thumbnail {
position : absolute; position : absolute;
top : 0; top : 0;
@@ -361,19 +336,15 @@
background-position : right top; background-position : right top;
background-size : cover; background-size : cover;
} }
.text { .text {
filter : drop-shadow(0 1px 4px black); filter : drop-shadow(0 1px 4px black);
h2 { font-weight : 900; } h2 { font-weight : 900; }
.description { .description {
height : 0; height : 0;
overflow : hidden; overflow : hidden;
transition : height 0.2s; transition : height 0.2s;
} }
} }
.info { .info {
display : grid; display : grid;
grid-template-areas : 'tags tags tags tags' grid-template-areas : 'tags tags tags tags'
@@ -383,11 +354,9 @@
grid-template-columns : 1fr 1fr 1fr 30px; grid-template-columns : 1fr 1fr 1fr 30px;
height : 110px; height : 110px;
filter : drop-shadow(0 1px 2px black); filter : drop-shadow(0 1px 2px black);
.brewTags { .brewTags {
grid-area : tags; grid-area : tags;
color : black; color : black;
i { color : white; } i { color : white; }
> span { background : hsl(from currentColor h 20% 80%); } > span { background : hsl(from currentColor h 20% 80%); }
} }
@@ -397,7 +366,6 @@
.lastUpdated { grid-area : update; } .lastUpdated { grid-area : update; }
.storage { grid-area : storage; } .storage { grid-area : storage; }
} }
.links { .links {
position : absolute; position : absolute;
right : 0; right : 0;
@@ -407,7 +375,6 @@
height : 40px; height : 40px;
} }
} }
@media screen and (max-width : 1400px) { @media screen and (max-width : 1400px) {
.brewCollection .brewGroup { .brewCollection .brewGroup {
&.list { &.list {
@@ -418,7 +385,6 @@
grid-template-columns : 2fr 1fr 20px; grid-template-columns : 2fr 1fr 20px;
width : clamp(200px, 100%, 650px); width : clamp(200px, 100%, 650px);
} }
.brewPages, .brewPages,
.lastViewed, .lastViewed,
.brewAuthors { display : none; } .brewAuthors { display : none; }
@@ -431,7 +397,6 @@
} }
} }
} }
@media screen and (max-width : 1200px) { @media screen and (max-width : 1200px) {
.brewCollection .brewGroup { .brewCollection .brewGroup {
&.list { &.list {
@@ -442,7 +407,6 @@
grid-template-columns : 1fr 20px; grid-template-columns : 1fr 20px;
width : clamp(200px, 100%, 650px); width : clamp(200px, 100%, 650px);
} }
.brewPages, .brewPages,
.lastViewed, .lastViewed,
.brewAuthors, .brewAuthors,
@@ -450,7 +414,6 @@
} }
.detailsOpen { .detailsOpen {
height : 100px; height : 100px;
.info { .info {
display : grid; display : grid;
grid-template-areas : 'tags views pages .' grid-template-areas : 'tags views pages .'
@@ -470,7 +433,6 @@
} }
} }
} }
@media screen and (max-width : 800px) { @media screen and (max-width : 800px) {
.brewCollection .brewGroup { .brewCollection .brewGroup {
&.list { &.list {
@@ -480,25 +442,21 @@
grid-template-columns : 1fr; grid-template-columns : 1fr;
width : clamp(200px, 100%, 650px); width : clamp(200px, 100%, 650px);
} }
.brewPages, .brewPages,
.lastViewed, .lastViewed,
.brewAuthors, .brewAuthors,
.lastUpdated, .lastUpdated,
.storage { display : none; } .storage { display : none; }
} }
.brewItem { transition : height 0.2s; } .brewItem { transition : height 0.2s; }
.detailsOpen { .detailsOpen {
display : grid; display : grid;
grid-template-columns : 3fr 3fr 30px; grid-template-columns : 3fr 3fr 30px;
height : 100px; height : 100px;
padding : 5px; padding : 5px;
.text { .text {
height : 100%; height : 100%;
padding : 0; padding : 0;
h2 { h2 {
display : -webkit-box; display : -webkit-box;
height : fit-content; height : fit-content;
@@ -510,7 +468,6 @@
-webkit-box-orient : vertical; -webkit-box-orient : vertical;
} }
} }
.info { .info {
display : grid; display : grid;
grid-template-areas : 'tags pages views views' grid-template-areas : 'tags pages views views'
@@ -530,7 +487,6 @@
} }
} }
} }
@media screen and (max-width : 650px) { @media screen and (max-width : 650px) {
.brewCollection .brewGroup { .brewCollection .brewGroup {
&.list { &.list {
@@ -542,7 +498,6 @@
grid-template-rows : 1fr 2fr; grid-template-rows : 1fr 2fr;
.info { .info {
display : grid; display : grid;
.lastUpdated { .lastUpdated {
width : 100px; width : 100px;
overflow : hidden; overflow : hidden;