Skip to content

Commit

Permalink
Fix styling on character sheet traits.
Browse files Browse the repository at this point in the history
Traits now properly utilize flex box and are more compact.
  • Loading branch information
StasTserk committed Dec 4, 2020
1 parent fd69840 commit 05b5102
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 46 deletions.
1 change: 1 addition & 0 deletions module/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export async function preloadHandlebarsTemplates(): Promise<void> {
"systems/burningwheel/templates/parts/rollable-item.hbs",
"systems/burningwheel/templates/parts/rollable-skill.hbs",
"systems/burningwheel/templates/parts/spell.hbs",
"systems/burningwheel/templates/parts/trait.hbs",
"systems/burningwheel/templates/parts/weapons.hbs",
"systems/burningwheel/templates/parts/character-settings.hbs",

Expand Down
33 changes: 19 additions & 14 deletions styles/character/bits.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,27 +53,32 @@
margin: 5px;

.trait {

@include colored-item(black);
textarea {
background-color: transparent;
min-height: 8em;
}
}

i {
float: right;
font-size: 12px;
margin-top: 6px;
margin-left: 5px;
color: transparentize($color: black, $amount: 0.25)
}
h3 {
margin-bottom: 0;
}

i:hover {
color: #FF0000;
}
}
label {
flex: 1 100px;
}

.trait-checkbox:checked + div > textarea {
display: none;
i {
flex: 0 12px;
font-size: 12px;
margin-top: 6px;
margin-left: 5px;
color: transparentize($color: black, $amount: 0.25)
}

i:hover {
color: #FF0000;
}
}
}
}
35 changes: 3 additions & 32 deletions templates/character-sheet.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -124,52 +124,23 @@
<i data-action="addTrait" data-id="character" class="fas fa-plus"></i>
</h2>
{{#each traits.character as |trait|}}
<div class="trait" data-item-id="{{trait._id}}" draggable="true" data-id="{{trait._id}}">
<h3>
{{ trait.name }}
<i class="fas fa-comment" data-action="broadcast" data-id="{{trait._id}}"></i>
<i class="fas fa-trash" data-action="delItem" data-id="{{trait._id}}"></i>
<i class="fas fa-edit" data-action="editItem" data-id="{{trait._id}}"></i>
</h3>
</div>
{{> "systems/burningwheel/templates/parts/trait.hbs" trait=trait}}
{{/each}}
</div>
<div class="trait-category">
<h2>Die Traits
<i data-action="addTrait" data-id="die" class="fas fa-plus"></i>
</h2>
{{#each traits.die as |trait|}}
<input type="checkbox" id="{{trait._id}}-toggle" class="hidden trait-checkbox" data-item-id="{{trait._id}}" data-binding="data.collapsed" {{ checked trait.data.collapsed }}>
<div class="trait" data-item-id="{{trait._id}}" draggable="true" data-id="{{trait._id}}">
<label for="{{trait._id}}-toggle">
<h3>
{{ trait.name }}
<i class="fas fa-comment" data-action="broadcast" data-id="{{trait._id}}"></i>
<i class="fas fa-trash" data-action="delItem" data-id="{{trait._id}}"></i>
<i class="fas fa-edit" data-action="editItem" data-id="{{trait._id}}"></i>
</h3>
</label>
<textarea disabled="disabled">{{trait.data.text}}</textarea>
</div>
{{> "systems/burningwheel/templates/parts/trait.hbs" trait=trait}}
{{/each}}
</div>
<div class="trait-category">
<h2>Call-on Traits
<i data-action="addTrait" data-id="call-on" class="fas fa-plus"></i>
</h2>
{{#each traits.callon as |trait|}}
<input type="checkbox" id="{{trait._id}}-toggle" class="hidden trait-checkbox" data-item-id="{{trait._id}}" data-binding="data.collapsed" {{ checked trait.data.collapsed }}>
<div class="trait" data-item-id="{{trait._id}}" draggable="true" data-id="{{trait._id}}">
<label for="{{trait._id}}-toggle">
<h3>
{{ trait.name }}
<i class="fas fa-comment" data-action="broadcast" data-id="{{trait._id}}"></i>
<i class="fas fa-trash" data-action="delItem" data-id="{{trait._id}}"></i>
<i class="fas fa-edit" data-action="editItem" data-id="{{trait._id}}"></i>
</h3>
</label>
<textarea disabled="disabled">{{ trait.data.text }}</textarea>
</div>
{{> "systems/burningwheel/templates/parts/trait.hbs" trait=trait}}
{{/each}}
</div>
</div>
Expand Down
13 changes: 13 additions & 0 deletions templates/parts/trait.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<div class="trait" data-item-id="{{trait._id}}" draggable="true" data-id="{{trait._id}}">
<h3 class="flex-row">
<input type="checkbox" id="{{trait._id}}-toggle" class="hidden trait-checkbox" data-item-id="{{trait._id}}" data-binding="data.collapsed" {{ checked trait.data.collapsed }}>
<label for="{{trait._id}}-toggle">{{ trait.name }}</label>
<i class="fas fa-comment" data-action="broadcast" data-id="{{trait._id}}"></i>
<i class="fas fa-edit" data-action="editItem" data-id="{{trait._id}}"></i>
<i class="fas fa-trash" data-action="delItem" data-id="{{trait._id}}"></i>
</h3>
{{#if trait.data.collapsed}}{{else}}
<hr>
<textarea disabled="disabled">{{ trait.data.text }}</textarea>
{{/if}}
</div>

0 comments on commit 05b5102

Please sign in to comment.