Skip to content

Commit

Permalink
[style]: fix icons on compat matrix page
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Balashov <[email protected]>
  • Loading branch information
0x009922 committed Nov 22, 2023
1 parent 067971e commit bf4ef1e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
32 changes: 19 additions & 13 deletions .vitepress/theme/components/CompatibilityMatrixTableIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ import { computed } from 'vue'
export type Status = 'ok' | 'failed' | 'no-data'
const props = defineProps<{
status: Status
}>()
const props = withDefaults(
defineProps<{
status: Status
inline: boolean
}>(),
{ inline: false },
)
// eslint-disable-next-line vue/return-in-computed-property
const chosenComponent = computed(() => {
Expand All @@ -24,25 +28,27 @@ const chosenComponent = computed(() => {
</script>

<template>
<component
:is="chosenComponent"
:data-status="status"
class="compat-matrix-table-icon"
/>
<component :is="chosenComponent" :data-status="status" :class="{ 'inline-icon': inline }" />

Check warning on line 31 in .vitepress/theme/components/CompatibilityMatrixTableIcon.vue

View workflow job for this annotation

GitHub Actions / check

':data-status' should be on a new line

Check warning on line 31 in .vitepress/theme/components/CompatibilityMatrixTableIcon.vue

View workflow job for this annotation

GitHub Actions / check

':class' should be on a new line
</template>

<style lang="scss">
svg.compat-matrix-table-icon {
<style lang="scss" scoped>
svg {
&[data-status='ok'] {
color: var(--vp-c-green);
color: var(--vp-c-green-1);
}
&[data-status='failed'] {
color: var(--vp-c-red);
color: var(--vp-c-red-1);
}
&[data-status='no-data'] {
color: var(--vp-c-yellow);
color: var(--vp-c-yellow-1);
}
}
.inline-icon {
display: inline;
vertical-align: middle;
}
</style>
6 changes: 3 additions & 3 deletions src/reference/compatibility-matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ The matrix consists of:
- **Stories**: Represented in the first column of the matrix, these are directly fetched from the TestOps API.
- **SDKs**: Each subsequent column represents an SDK, such as "Java/Kotlin", "JavaScript", "Swift", etc.
- **Status Symbols**: The status of each story for an SDK is denoted with:
- <CompatibilityMatrixTableIcon status="ok" class="inline-block relative -top-0.5" /> indicating the story passed.
- <CompatibilityMatrixTableIcon status="failed" class="inline-block relative -top-0.5" /> indicating the story failed to pass.
- <CompatibilityMatrixTableIcon status="no-data" class="inline-block relative -top-0.5" /> indicating the data is missing.
- <CompatibilityMatrixTableIcon status="ok" inline /> indicating the story passed.
- <CompatibilityMatrixTableIcon status="failed" inline /> indicating the story failed to pass.
- <CompatibilityMatrixTableIcon status="no-data" inline /> indicating the data is missing.

<CompatibilityMatrixTable />

Expand Down

0 comments on commit bf4ef1e

Please sign in to comment.