Skip to content

Commit

Permalink
Initial refactor for V2 sheet code and CSS sharing. (foundryvtt#3924)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fyorl authored Aug 2, 2024
1 parent a40e52c commit 65b1d55
Show file tree
Hide file tree
Showing 43 changed files with 1,017 additions and 719 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.hbs]
indent_size = 4
1 change: 0 additions & 1 deletion dnd5e.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ Hooks.once("init", function() {
});
Actors.registerSheet("dnd5e", applications.actor.ActorSheet5eNPC, {
types: ["npc"],
makeDefault: true,
label: "DND5E.SheetClassNPCLegacy"
});
DocumentSheetConfig.registerSheet(Actor, "dnd5e", applications.actor.ActorSheet5eNPC2, {
Expand Down
3 changes: 3 additions & 0 deletions less/dnd5e.less
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

/* V2 Styles */
@import "v2/apps.less";
@import "v2/forms.less";
@import "v2/sheets.less";
@import "v2/activities.less";
@import "v2/actors.less";
@import "v2/character.less";
Expand All @@ -30,6 +32,7 @@

/* Dark Mode */
@import "v2/dark/apps.less";
@import "v2/dark/forms.less";
@import "v2/dark/actors.less";
@import "v2/dark/character.less";
@import "v2/dark/npc.less";
Expand Down
3 changes: 2 additions & 1 deletion less/elements.less
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,10 @@ item-list-controls search, .dnd5e2 .filter-element search {
height: unset;
line-height: 1;
font-family: var(--dnd5e-font-roboto);
outline: none;

&:hover, &:focus-visible {
outline: 0;
outline: none;
box-shadow: 0 0 12px var(--dnd5e-color-gold);
}
}
Expand Down
106 changes: 0 additions & 106 deletions less/v2/actors.less
Original file line number Diff line number Diff line change
Expand Up @@ -14,39 +14,6 @@
border-radius: 5px;
}

> header {
background: transparent;
position: relative;
z-index: 1;

.window-title { visibility: hidden; }

/* Edit Mode Toggle */
> slide-toggle {
--slide-toggle-track-color-checked: var(--dnd5e-color-gold);
--slide-toggle-track-color-unchecked: var(--dnd5e-color-light-gray);
flex: none;

.slide-toggle-thumb {
line-height: 12px;

&::before {
content: "\f0ad";
font-family: var(--font-awesome);
color: var(--dnd5e-color-light-gray);
font-weight: bold;
font-size: var(--font-size-9);
}
}

&[checked] .slide-toggle-thumb::before {
color: var(--dnd5e-color-gold);
}
}
}

.window-content { margin-top: -30px; }

/* ---------------------------------- */
/* Navigation */
/* ---------------------------------- */
Expand All @@ -60,17 +27,6 @@
/* ---------------------------------- */

.sheet-header {
input, select {
background: rgb(0 0 0 / 45%);
border: 1px solid transparent;
transition: all 250ms ease;

&:hover, &:focus {
border: 1px solid var(--dnd5e-color-gold);
box-shadow: 0 0 6px var(--dnd5e-color-gold);
}
}

/* Resting & Special Traits */
.sheet-header-buttons {
display: flex;
Expand All @@ -90,39 +46,6 @@
}
}

/* ---------------------------------- */
/* Badges */
/* ---------------------------------- */

.badge {
background: transparent no-repeat center / contain;
font-family: var(--dnd5e-font-roboto);
font-weight: bold;
color: var(--color-text-light-0);
display: grid;
place-content: center;
font-size: var(--font-size-30);

.config-button {
color: inherit;
font-size: inherit;
}
}

/* AC */
.ac-badge {
width: 68px;
height: 68px;
text-align: center;
line-height: 62px;
background-image: url("ui/ac-badge.webp");
display: block;
place-content: unset;
font-size: var(--font-size-23);
margin-top: -21px;
filter: drop-shadow(0 0 6px var(--color-shadow-dark));
}

/* ---------------------------------- */
/* Meters */
/* ---------------------------------- */
Expand Down Expand Up @@ -323,35 +246,6 @@
}
}

.prosemirror menu {
.pm-dropdown {
background: none;
&:hover { background: var(--color-hover-bg); }
}

button {
display: unset;
text-transform: unset;
box-shadow: none;
font-family: var(--font-primary);
font-size: var(--font-size-14);
font-weight: normal;
line-height: 28px;
}
}

/* ---------------------------------- */
/* Child Creation */
/* ---------------------------------- */

.create-child {
display: none;
position: absolute;
inset: auto 16px 16px auto;
}

form:is(.tab-inventory, .tab-features, .tab-spells, .tab-effects) .create-child { display: block; }

/* ---------------------------------- */
/* Warnings */
/* ---------------------------------- */
Expand Down
Loading

0 comments on commit 65b1d55

Please sign in to comment.