Skip to content

Commit

Permalink
Small adjustments to the styling
Browse files Browse the repository at this point in the history
  • Loading branch information
ltouroumov committed Sep 6, 2024
1 parent fb5aac9 commit b8e5ba8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 18 deletions.
24 changes: 14 additions & 10 deletions components/viewer/ViewRequirement.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
<template>
<div
v-if="req.showRequired || showAlways"
class="obj-requirement score"
class="obj-requirement"
:class="{ disabled: !isEnabled }"
>
<span v-if="!req.required && showAlways">Incompatible: </span>
<span v-else-if="req.beforeText">{{ req.beforeText }}</span>
<div v-if="req.type === 'id'">
<span v-if="!req.required && showAlways" class="req-before-text">
Incompatible:
</span>
<span v-else-if="req.beforeText" class="req-before-text">
{{ req.beforeText }}
</span>
<template v-if="req.type === 'id'">
<span>{{ getObject(req.reqId)?.title ?? '???' }}</span>
</div>
<div v-else-if="req.type === 'or'">
</template>
<template v-else-if="req.type === 'or'">
<span v-for="(orReq, idx) in req.orRequired" :key="idx">
<template v-if="orReq.req">
<span v-if="idx > 0"
Expand All @@ -19,7 +23,7 @@
{{ getObject(orReq.req)?.title ?? '???' }}
</template>
</span>
</div>
</template>
<div v-else>Unknown Condition</div>
<span v-if="req.afterText">{{ req.afterText }}</span>
</div>
Expand All @@ -45,9 +49,9 @@ const isEnabled = computed<boolean>(() => condition(selectedIds.value));

<style lang="scss">
.obj-requirement {
display: flex;
flex-direction: row;
gap: 5px;
.req-before-text {
margin-right: 0.2rem;
}
&.disabled {
display: none;
Expand Down
4 changes: 2 additions & 2 deletions components/viewer/ViewScore.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="score" :class="{ disabled: !isEnabled }">
<div class="obj-score" :class="{ disabled: !isEnabled }">
<span v-if="score.beforeText" class="score-before">{{
score.beforeText
}}</span>
Expand Down Expand Up @@ -28,7 +28,7 @@ const isEnabled = computed<boolean>(() => condition(selectedIds.value));
</script>

<style lang="scss">
.score {
.obj-score {
display: flex;
flex-direction: row;
gap: 5px;
Expand Down
12 changes: 6 additions & 6 deletions components/viewer/style/engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,12 @@ export class ObjStylesGen extends StyleGenerator<ObjStyles> {
}
}
.score {
font-family: {{scoreText}};
font-size: {{scoreTextSize}}%;
text-align: {{scoreTextAlign}};
color: {{scoreTextColor}};
}
.obj-score, .obj-requirements {
font-family: {{scoreText}};
font-size: {{scoreTextSize}}%;
text-align: {{scoreTextAlign}};
color: {{scoreTextColor}};
}
/* FIXME: Disabled as it messes up parent colunms, appears related to grid.css
margin: {{objectMargin}}px;
Expand Down

0 comments on commit b8e5ba8

Please sign in to comment.