moved basic talent properties in talent-sheet head

- a little bit better gridding of side-properties
  (still needs a rewrite)
- common SCSS mixin for input field marking
This commit is contained in:
Gesina Schwalbe 2021-01-06 15:25:55 +01:00
parent 3ba5efb8a7
commit 874692ed5c
5 changed files with 33 additions and 19 deletions

View file

@ -1,13 +1,20 @@
.basic-properties { .basic-properties {
flex: 0 0 100%; flex: 0 0 100%;
.basic-property { .basic-property {
.basic-property-label { display: grid;
align-content: end;
.basic-property-label,
& > label {
font-weight: bold; font-weight: bold;
} }
.basic-property-select { .basic-property-select,
& > select {
display: block; display: block;
width: 100%; width: 100%;
} }
@include mark-invalid-or-disabled-input;
} }
} }

View file

@ -9,7 +9,7 @@
.side-property { .side-property {
margin: 2px 0; margin: 2px 0;
display: grid; display: grid;
grid-template-columns: 40% auto; grid-template-columns: minmax(30%, auto) auto;
justify-content: left; justify-content: left;
label { label {
@ -22,12 +22,9 @@
text-align: left; text-align: left;
width: calc(100% - 2px); width: calc(100% - 2px);
} }
input:invalid {
background-color: $c-invalid-input; @include mark-invalid-or-disabled-input;
}
input:disabled {
background-color: transparent;
}
input[type="checkbox"] { input[type="checkbox"] {
width: auto; width: auto;
height: 100%; height: 100%;

View file

@ -39,9 +39,8 @@
height: 100%; height: 100%;
margin: 0px; margin: 0px;
} }
input:invalid {
background-color: $c-invalid-input; @include mark-invalid-or-disabled-input;
}
} }
.item-name { .item-name {

View file

@ -19,3 +19,12 @@
display: grid; display: grid;
place-items: center; place-items: center;
} }
@mixin mark-invalid-or-disabled-input {
input:invalid {
background-color: $c-invalid-input;
}
input:disabled {
background-color: transparent;
}
}

View file

@ -3,9 +3,9 @@
{{!-- ======================================================================== --}} {{!-- ======================================================================== --}}
{{#*inline "talentRankSideProperty" }} {{#*inline "talentRankBasicProperty" }}
<div class="side-property"> <div class="basic-property">
<label for="data.rank.{{property}}">{{localize localizeString}}</label> <label class="basic-property-label" for="data.rank.{{property}}">{{localize localizeString}}</label>
<input type="number" min="0" step="1" data-dtype="Number" {{disabled}} <input type="number" min="0" step="1" data-dtype="Number" {{disabled}}
{{#if (eq property 'base') }}max="{{data.rank.max}}"{{/if}} {{#if (eq property 'base') }}max="{{data.rank.max}}"{{/if}}
name="data.rank.{{property}}" value="{{lookup data.rank property}}" /> name="data.rank.{{property}}" value="{{lookup data.rank property}}" />
@ -22,6 +22,12 @@
<div class="header-fields flexrow"> <div class="header-fields flexrow">
<h1 class="charname"><input name="name" type="text" value="{{item.name}}" placeholder="Name" /></h1> <h1 class="charname"><input name="name" type="text" value="{{item.name}}" placeholder="Name" /></h1>
<h2 class="item-type">{{localize (lookup config.itemTypes item.type)}}</h2> <h2 class="item-type">{{localize (lookup config.itemTypes item.type)}}</h2>
<div class="grid grid-4col basic-properties">
{{> talentRankBasicProperty data=data property='base' localizeString='DS4.TalentRankBase' }}
{{> talentRankBasicProperty data=data property='max' localizeString='DS4.TalentRankMax'}}
{{> talentRankBasicProperty data=data property='mod' localizeString='DS4.TalentRankMod'}}
{{> talentRankBasicProperty data=data property='total' localizeString='DS4.TalentRankTotal' disabled='disabled'}}
</div>
</div> </div>
</header> </header>
@ -52,10 +58,6 @@
{{else}} {{else}}
<span>{{localize "DS4.NotOwned"}}</span> <span>{{localize "DS4.NotOwned"}}</span>
{{/if}} {{/if}}
{{> talentRankSideProperty data=data property='base' localizeString='DS4.TalentRankBase' }}
{{> talentRankSideProperty data=data property='max' localizeString='DS4.TalentRankMax'}}
{{> talentRankSideProperty data=data property='mod' localizeString='DS4.TalentRankMod'}}
{{> talentRankSideProperty data=data property='total' localizeString='DS4.TalentRankTotal' disabled='disabled'}}
</div> </div>
<div class="description" title="{{localize 'DS4.HeadingDescription'}}"> <div class="description" title="{{localize 'DS4.HeadingDescription'}}">
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}} {{editor content=data.description target="data.description" button=true owner=owner editable=editable}}