mirror of
https://github.com/jaronpate/folio.git
synced 2026-10-19 01:07:39 +00:00
redaction component, margin not stacking, other cleanup
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<script setup lang="ts">
|
||||
import {
|
||||
redactionFamily,
|
||||
resolveRedactionStrength,
|
||||
} from '~/utils/fonts';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
strength?: number | string;
|
||||
}>(),
|
||||
{
|
||||
strength: 35,
|
||||
},
|
||||
);
|
||||
|
||||
const grade = computed(() => resolveRedactionStrength(props.strength));
|
||||
const family = computed(
|
||||
() => `'${redactionFamily(grade.value)}', Georgia, serif`,
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<span
|
||||
class="redacted"
|
||||
:data-strength="grade"
|
||||
:style="{ fontFamily: family }"
|
||||
><slot /></span>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.redacted {
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
:where(strong, b) .redacted {
|
||||
font-weight: 700;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user