Skip to content

Commit

Permalink
Assorted styling fixes.
Browse files Browse the repository at this point in the history
 - Add minimum height and width to compendium browser images.
 - Fix missing images in resistance pills.
 - Ensure v2 Actor sheets have a default image.
  • Loading branch information
Fyorl committed Jul 18, 2024
1 parent 5638160 commit 5e76fa8
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 14 deletions.
1 change: 1 addition & 0 deletions less/elements.less
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ item-list-controls search, .dnd5e2 .filter-element search {

> input[type="text"] {
--input-placeholder-color: var(--color-text-dark-secondary);
color: var(--color-text-dark-primary);
flex: 1;
background: none;
border: none;
Expand Down
14 changes: 14 additions & 0 deletions less/v2/actors.less
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,20 @@
.pill-lg.empty { width: 240px; }
}

/* ---------------------------------- */
/* Pills */
/* ---------------------------------- */

.pills-group .pill > i {
font-family: var(--font-awesome);
font-weight: bold;
font-style: normal;

&.ada::before { content: "\f132"; }
&.mgc::before { content: "\f72b"; }
&.sil::before { content: "\53"; }
}

/* ---------------------------------- */
/* Spells */
/* ---------------------------------- */
Expand Down
14 changes: 1 addition & 13 deletions less/v2/character.less
Original file line number Diff line number Diff line change
Expand Up @@ -828,19 +828,7 @@
> h3 > a { color: var(--dnd5e-color-black); }
}

.pill {
padding: .25rem .5rem;

> i {
font-family: var(--font-awesome);
font-weight: bold;
font-style: normal;

&.ada::before { content: "\f132"; }
&.mgc::before { content: "\f72b"; }
&.sil::before { content: "\53"; }
}
}
.pill { padding: .25rem .5rem; }
}
}

Expand Down
2 changes: 2 additions & 0 deletions less/v2/inventory.less
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@
width: 32px;
height: 32px;
object-fit: cover;
min-width: 32px;
min-height: 32px;
}

/* Item Weight & Price */
Expand Down
4 changes: 3 additions & 1 deletion module/applications/actor/sheet-v2-mixin.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export default function ActorSheetV2Mixin(Base) {
const firstButton = header.querySelector(".header-button");
firstButton?.insertAdjacentElement("beforebegin", idLink);
idLink.classList.add("header-button");
idLink.dataset.tooltipDirection = "DOWN";
}

// Render tabs.
Expand Down Expand Up @@ -140,9 +141,10 @@ export default function ActorSheetV2Mixin(Base) {
// Portrait
const showTokenPortrait = this.actor.getFlag("dnd5e", "showTokenPortrait") === true;
const token = this.actor.isToken ? this.actor.token : this.actor.prototypeToken;
const defaultArtwork = Actor.implementation.getDefaultArtwork(context.source)?.img;
context.portrait = {
token: showTokenPortrait,
src: showTokenPortrait ? token.texture.src : this.actor.img,
src: showTokenPortrait ? token.texture.src : this.actor.img ?? defaultArtwork,
// TODO: Not sure the best way to update the parent texture from this sheet if this is a token actor.
path: showTokenPortrait ? this.actor.isToken ? "" : "prototypeToken.texture.src" : "img"
};
Expand Down

0 comments on commit 5e76fa8

Please sign in to comment.