FEAT: add appTheme mixin on less files (#256)

Co-authored-by: Joaquin Pereyra <joaquinpereyra98@users.noreply.github.com>
This commit is contained in:
joaquinpereyra98 2025-07-03 18:26:03 -03:00 committed by GitHub
parent cae659b9a5
commit 122621a57a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 472 additions and 449 deletions

View file

@ -1,6 +1,17 @@
@import '../../utils/colors.less';
@import '../../utils/fonts.less';
// Theme header backgrounds
.appTheme({
.character-header-sheet .trait {
background: url(../assets/svg/trait-shield.svg) no-repeat;
}
}, {
.character-header-sheet .trait {
background: url('../assets/svg/trait-shield-light.svg') no-repeat;
}
});
.application.sheet.daggerheart.actor.dh-style.character {
.character-header-sheet {
padding: 0 15px;
@ -153,14 +164,8 @@
.trait {
height: 60px;
width: 60px;
background: url(../assets/svg/trait-shield.svg) no-repeat;
cursor: pointer;
.theme-light & {
background: url('../assets/svg/trait-shield-light.svg') no-repeat;
}
.trait-name {
display: flex;
align-items: center;

View file

@ -1,305 +1,310 @@
@import '../../utils/colors.less';
@import '../../utils/fonts.less';
.application.sheet.daggerheart.actor.dh-style.character {
// Theme sidebar backgrounds
.appTheme({
.character-sidebar-sheet {
width: 275px;
min-width: 275px;
border-right: 1px solid light-dark(@dark-blue, @golden);
background-image: url('../assets/parchments/dh-parchment-dark.png');
.experience-value {
background: url(../assets/svg/experience-shield.svg) no-repeat;
}
}
}, {
.character-sidebar-sheet {
background: transparent;
.experience-value {
background: url('../assets/svg/experience-shield-light.svg') no-repeat;
}
}
});
.theme-light & {
background: transparent;
.application.sheet.dh-style .character-sidebar-sheet {
width: 275px;
min-width: 275px;
border-right: 1px solid light-dark(@dark-blue, @golden);
.portrait {
position: relative;
border-bottom: 1px solid light-dark(@dark-blue, @golden);
cursor: pointer;
img {
height: 235px;
width: 275px;
object-fit: cover;
}
.portrait {
position: relative;
border-bottom: 1px solid light-dark(@dark-blue, @golden);
cursor: pointer;
.death-roll-btn {
display: none;
}
img {
height: 235px;
width: 275px;
object-fit: cover;
}
&.death-roll {
filter: grayscale(1);
.death-roll-btn {
display: none;
}
display: flex;
position: absolute;
top: 30%;
right: 30%;
font-size: 6rem;
color: @beige;
&.death-roll {
filter: grayscale(1);
.death-roll-btn {
display: flex;
position: absolute;
top: 30%;
right: 30%;
font-size: 6rem;
color: @beige;
&:hover {
text-shadow: 0 0 8px @beige;
}
&:hover {
text-shadow: 0 0 8px @beige;
}
}
}
}
.info-section {
position: relative;
.info-section {
position: relative;
display: flex;
flex-direction: column;
top: -20px;
gap: 30px;
margin-bottom: -10px;
.resources-section {
display: flex;
flex-direction: column;
top: -20px;
gap: 30px;
margin-bottom: -10px;
justify-content: space-evenly;
.resources-section {
display: flex;
justify-content: space-evenly;
.status-bar {
position: relative;
width: 100px;
height: 40px;
justify-items: center;
.status-bar {
.status-label {
position: relative;
top: 40px;
height: 22px;
width: 79px;
clip-path: path('M0 0H79L74 16.5L39 22L4 16.5L0 0Z');
background: light-dark(@dark-blue, @golden);
h4 {
font-weight: bold;
text-align: center;
line-height: 18px;
color: light-dark(@beige, @dark-blue);
}
}
.status-value {
position: absolute;
display: flex;
padding: 0 6px;
font-size: 1.5rem;
align-items: center;
width: 100px;
height: 40px;
justify-items: center;
justify-content: center;
text-align: center;
z-index: 2;
color: @beige;
.status-label {
position: relative;
top: 40px;
height: 22px;
width: 79px;
clip-path: path('M0 0H79L74 16.5L39 22L4 16.5L0 0Z');
background: light-dark(@dark-blue, @golden);
h4 {
font-weight: bold;
text-align: center;
line-height: 18px;
color: light-dark(@beige, @dark-blue);
}
}
.status-value {
position: absolute;
display: flex;
padding: 0 6px;
input[type='number'] {
background: transparent;
font-size: 1.5rem;
align-items: center;
width: 100px;
height: 40px;
justify-content: center;
width: 40px;
height: 30px;
text-align: center;
z-index: 2;
border: none;
outline: 2px solid transparent;
color: @beige;
input[type='number'] {
background: transparent;
font-size: 1.5rem;
width: 40px;
height: 30px;
text-align: center;
border: none;
outline: 2px solid transparent;
&.bar-input {
padding: 0;
color: @beige;
backdrop-filter: none;
background: transparent;
transition: all 0.3s ease;
&.bar-input {
padding: 0;
color: @beige;
backdrop-filter: none;
background: transparent;
transition: all 0.3s ease;
&:hover,
&:focus {
background: @semi-transparent-dark-blue;
backdrop-filter: blur(9.5px);
}
&:hover,
&:focus {
background: @semi-transparent-dark-blue;
backdrop-filter: blur(9.5px);
}
}
.bar-label {
width: 40px;
}
}
.progress-bar {
position: absolute;
appearance: none;
width: 100px;
height: 40px;
border: 1px solid light-dark(@dark-blue, @golden);
border-radius: 6px;
z-index: 1;
.bar-label {
width: 40px;
}
}
.progress-bar {
position: absolute;
appearance: none;
width: 100px;
height: 40px;
border: 1px solid light-dark(@dark-blue, @golden);
border-radius: 6px;
z-index: 1;
background: @dark-blue;
&::-webkit-progress-bar {
border: none;
background: @dark-blue;
&::-webkit-progress-bar {
border: none;
background: @dark-blue;
border-radius: 6px;
}
&::-webkit-progress-value {
background: @gradient-hp;
border-radius: 6px;
}
&.stress-color::-webkit-progress-value {
background: @gradient-stress;
border-radius: 6px;
}
&::-moz-progress-bar {
background: @gradient-hp;
border-radius: 6px;
}
&.stress-color::-moz-progress-bar {
background: @gradient-stress;
border-radius: 6px;
}
border-radius: 6px;
}
}
}
.status-section {
display: flex;
flex-wrap: wrap;
gap: 5px;
justify-content: center;
.status-number {
justify-items: center;
.status-value {
position: relative;
display: flex;
width: 50px;
height: 30px;
border: 1px solid light-dark(@dark-blue, @golden);
border-bottom: none;
border-radius: 6px 6px 0 0;
padding: 0 6px;
font-size: 1.2rem;
align-items: center;
justify-content: center;
background: light-dark(transparent, @dark-blue);
z-index: 2;
&.armor-slots {
width: 80px;
height: 30px;
}
&::-webkit-progress-value {
background: @gradient-hp;
border-radius: 6px;
}
.status-label {
padding: 2px 10px;
width: 100%;
border-radius: 3px;
background: light-dark(@dark-blue, @golden);
h4 {
font-weight: bold;
text-align: center;
line-height: 18px;
font-size: 12px;
color: light-dark(@beige, @dark-blue);
}
&.stress-color::-webkit-progress-value {
background: @gradient-stress;
border-radius: 6px;
}
&::-moz-progress-bar {
background: @gradient-hp;
border-radius: 6px;
}
&.stress-color::-moz-progress-bar {
background: @gradient-stress;
border-radius: 6px;
}
}
}
}
.items-sidebar-list {
.status-section {
display: flex;
flex-direction: column;
flex-wrap: wrap;
gap: 5px;
justify-content: center;
.inventory-item {
padding: 0 10px;
}
}
.status-number {
justify-items: center;
.equipment-section {
.title {
display: flex;
gap: 15px;
align-items: center;
h3 {
font-size: 20px;
}
}
.items-list {
display: flex;
flex-direction: column;
gap: 10px;
align-items: center;
}
}
.loadout-section {
.title {
display: flex;
gap: 15px;
align-items: center;
h3 {
font-size: 20px;
}
}
}
.experience-section {
.title {
display: flex;
gap: 15px;
align-items: center;
h3 {
font-size: 20px;
}
}
.experience-list {
display: flex;
flex-direction: column;
gap: 5px;
width: 100%;
margin-top: 10px;
align-items: center;
.experience-row {
.status-value {
position: relative;
display: flex;
gap: 5px;
width: 250px;
width: 50px;
height: 30px;
border: 1px solid light-dark(@dark-blue, @golden);
border-bottom: none;
border-radius: 6px 6px 0 0;
padding: 0 6px;
font-size: 1.2rem;
align-items: center;
justify-content: space-between;
justify-content: center;
background: light-dark(transparent, @dark-blue);
z-index: 2;
input[type='text'] {
height: 32px;
width: 180px;
border: 1px solid transparent;
outline: 2px solid transparent;
font-size: 14px;
font-family: @font-body;
transition: all 0.3s ease;
color: light-dark(@dark, @beige);
&:hover {
outline: 2px solid light-dark(@dark, @beige);
}
&.armor-slots {
width: 80px;
height: 30px;
}
}
.experience-value {
height: 25px;
width: 35px;
font-size: 14px;
font-family: @font-body;
color: light-dark(@dark, @beige);
align-content: center;
text-align: center;
background: url(../assets/svg/experience-shield.svg) no-repeat;
.status-label {
padding: 2px 10px;
width: 100%;
border-radius: 3px;
background: light-dark(@dark-blue, @golden);
.theme-light & {
background: url('../assets/svg/experience-shield-light.svg') no-repeat;
h4 {
font-weight: bold;
text-align: center;
line-height: 18px;
font-size: 12px;
color: light-dark(@beige, @dark-blue);
}
}
}
}
}
.items-sidebar-list {
display: flex;
flex-direction: column;
gap: 5px;
.inventory-item {
padding: 0 10px;
}
}
.equipment-section {
.title {
display: flex;
gap: 15px;
align-items: center;
h3 {
font-size: 20px;
}
}
.items-list {
display: flex;
flex-direction: column;
gap: 10px;
align-items: center;
}
}
.loadout-section {
.title {
display: flex;
gap: 15px;
align-items: center;
h3 {
font-size: 20px;
}
}
}
.experience-section {
.title {
display: flex;
gap: 15px;
align-items: center;
h3 {
font-size: 20px;
}
}
.experience-list {
display: flex;
flex-direction: column;
gap: 5px;
width: 100%;
margin-top: 10px;
align-items: center;
.experience-row {
display: flex;
gap: 5px;
width: 250px;
align-items: center;
justify-content: space-between;
input[type='text'] {
height: 32px;
width: 180px;
border: 1px solid transparent;
outline: 2px solid transparent;
font-size: 14px;
font-family: @font-body;
transition: all 0.3s ease;
color: light-dark(@dark, @beige);
&:hover {
outline: 2px solid light-dark(@dark, @beige);
}
}
}
.experience-value {
height: 25px;
width: 35px;
font-size: 14px;
font-family: @font-body;
color: light-dark(@dark, @beige);
align-content: center;
text-align: center;
}
}
}
}

View file

@ -1,10 +1,17 @@
.application.sheet.daggerheart.actor.dh-style.companion {
.theme-light & {
background: url('../assets/parchments/dh-parchment-light.png');
}
.theme-dark & {
// Theme header backgrounds
.appTheme({
&.companion {
background-image: url('../assets/parchments/dh-parchment-dark.png');
}
}, {
&.companion {
background: url('../assets/parchments/dh-parchment-light.png');
}
});
.application.sheet.daggerheart.actor.dh-style.companion {
// .profile {
// height: 80px;

View file

@ -1,13 +1,17 @@
@import '../../utils/colors.less';
@import '../../utils/fonts.less';
.application.sheet.daggerheart.actor.dh-style.environment {
.theme-light & {
background: url('../assets/parchments/dh-parchment-light.png');
}
.theme-dark & {
.appTheme({
&.environment {
background-image: url('../assets/parchments/dh-parchment-dark.png');
}
}, {
&.environment {
background: url('../assets/parchments/dh-parchment-light.png');
}
});
.application.sheet.daggerheart.actor.dh-style.environment {
.tab {
max-height: 300px;

View file

@ -1,21 +1,19 @@
@import '../utils/colors.less';
@import '../utils/fonts.less';
.theme-light {
.application.dialog.dh-style {
background-image: url('../assets/parchments/dh-parchment-light.png');
background-repeat: no-repeat;
background-position: center;
}
}
.theme-dark {
.application.dialog.dh-style {
.appTheme({
&.dialog {
background-image: url('../assets/parchments/dh-parchment-dark.png');
background-repeat: no-repeat;
background-position: center;
}
}
}, {
&.dialog {
background-image: url('../assets/parchments/dh-parchment-light.png');
background-repeat: no-repeat;
background-position: center;
}
});
.application.dialog.dh-style {
border: none;

View file

@ -1,91 +1,70 @@
@import '../utils/colors.less';
@import '../utils/fonts.less';
@import '../utils/mixin.less';
.application.sheet.dh-style .window-header {
background: transparent;
border-bottom: none;
justify-content: end;
// Theme handling
.appTheme({
background: @semi-transparent-dark-blue;
backdrop-filter: blur(9px);
}, {
background: url('../assets/parchments/dh-parchment-light.png') no-repeat center;
});
h1 {
color: light-dark(@dark-blue, @beige);
font-family: @font-body;
}
button {
background: light-dark(transparent, @deep-black);
color: light-dark(@dark-blue, @beige);
border: 1px solid light-dark(@dark-blue, transparent);
padding: 0;
&:hover {
border: 1px solid light-dark(@dark-blue, @golden);
color: light-dark(@dark-blue, @golden);
}
}
}
.application.sheet.dh-style:not(.minimized) {
.window-title,
.window-icon {
display: none;
opacity: 0;
transition: opacity 0.3s ease;
}
}
.application.sheet.dh-style.minimized {
.window-content {
opacity: 0;
transition: opacity 0.1s ease;
}
}
.application.sheet.dh-style:not(.minimized) {
.window-content {
opacity: 1;
transition: opacity 0.3s ease;
}
}
.theme-dark {
.application.sheet.dh-style {
background: @semi-transparent-dark-blue;
backdrop-filter: blur(9px);
}
}
.theme-light {
.application.sheet.dh-style {
background-image: url('../assets/parchments/dh-parchment-light.png');
background-repeat: no-repeat;
background-position: center;
}
}
.application.sheet.daggerheart.dh-style {
.application.sheet.dh-style {
border-radius: 10px;
// Window header styles
.window-header {
background: transparent;
border-bottom: none;
justify-content: end;
h1 {
color: light-dark(@dark-blue, @beige);
font-family: @font-body;
}
button {
background: light-dark(transparent, @deep-black);
color: light-dark(@dark-blue, @beige);
border: 1px solid light-dark(@dark-blue, transparent);
padding: 0;
&:hover {
border-color: light-dark(@dark-blue, @golden);
color: light-dark(@dark-blue, @golden);
}
}
}
// Window content transitions
.window-content {
padding: 0;
position: relative;
top: -36px;
min-height: -webkit-fill-available;
transition: opacity 0.3s ease;
.tab {
padding: 0 10px;
}
}
}
.application.sheet.daggerheart.character.dh-style {
border-radius: 10px;
// Minimized states
&.minimized .window-content {
opacity: 0;
transition-duration: 0.1s;
}
.window-content {
position: absolute;
top: 0;
.tab {
padding: 0 15px;
overflow-y: hidden;
&:not(.minimized) {
.window-title,
.window-icon {
display: none;
opacity: 0;
transition: opacity 0.3s ease;
}
.window-content {
opacity: 1;
}
}
}

View file

@ -0,0 +1,18 @@
/**
* Applies theme-specific styles.
* @param {Rules} @darkRules - Styles to apply when `.theme-dark` is present
* @param {Rules} @lightRules - Styles to apply when `.theme-light` is present
*/
.appTheme(@darkRules, @lightRules) {
.themed {
&.theme-dark .application.sheet.dh-style,
&.theme-dark.application.sheet.dh-style {
@darkRules();
}
&.theme-light .application.sheet.dh-style,
&.theme-light.application.sheet.dh-style {
@lightRules();
}
}
}