primevue-mirror/doc/theming/styled/ScopedCSSDoc.vue

66 lines
2.2 KiB
Vue
Raw Normal View History

2023-02-28 08:29:30 +00:00
<template>
<DocSectionText v-bind="$attrs">
2024-03-31 12:29:10 +00:00
<p>Design tokens can be scoped to a certain component using CSS variables. In an upcoming update, a special <i>dt</i> property would be introduced to generate the CSS variables from a design token object.</p>
2023-02-28 08:29:30 +00:00
</DocSectionText>
2024-03-31 12:29:10 +00:00
<div class="card flex justify-content-center gap-3">
<InputSwitch v-model="checked1" class="blue-switch" />
<InputSwitch v-model="checked2" class="amber-switch" />
2023-02-28 08:29:30 +00:00
</div>
2024-03-31 12:29:10 +00:00
<DocSectionCode :code="code1" hideToggleCode hideStackBlitz />
2024-01-30 08:16:35 +00:00
<DocSectionCode :code="code2" hideToggleCode hideStackBlitz />
2023-02-28 08:29:30 +00:00
</template>
<script>
export default {
data() {
return {
2024-03-31 12:29:10 +00:00
checked1: true,
checked2: true,
2023-02-28 08:29:30 +00:00
code1: {
2023-09-22 12:54:14 +00:00
basic: `
2024-03-31 12:29:10 +00:00
<InputSwitch v-model="checked1" class="blue-switch" />
<InputSwitch v-model="checked2" class="amber-switch" />
2023-10-15 09:38:39 +00:00
`
2023-02-28 08:29:30 +00:00
},
code2: {
2023-09-22 12:54:14 +00:00
basic: `
2024-03-31 12:29:10 +00:00
<style scoped>
.blue-switch {
--p-inputswitch-checked-background: var(--p-blue-500);
--p-inputswitch-checked-hover-background: var(--p-blue-500);
--p-inputswitch-border-radius: 4px;
}
.amber-switch {
--p-inputswitch-checked-background: var(--p-amber-500);
--p-inputswitch-checked-hover-background: var(--p-amber-500);
--p-inputswitch-handle-background: var(--p-zinc-950);
--p-inputswitch-handle-hover-background: var(--p-zinc-950);
--p-inputswitch-handle-checked-background: var(--p-zinc-950);
--p-inputswitch-handle-checked-hover-background: var(--p-zinc-950);
}
</style>
2023-10-15 09:38:39 +00:00
`
2023-02-28 08:29:30 +00:00
}
};
}
};
</script>
<style scoped>
2024-03-31 12:29:10 +00:00
.blue-switch {
--p-inputswitch-checked-background: var(--p-blue-500);
--p-inputswitch-checked-hover-background: var(--p-blue-500);
--p-inputswitch-border-radius: 4px;
2023-02-28 08:29:30 +00:00
}
2024-03-31 12:29:10 +00:00
.amber-switch {
--p-inputswitch-checked-background: var(--p-amber-500);
--p-inputswitch-checked-hover-background: var(--p-amber-500);
--p-inputswitch-handle-background: var(--p-zinc-950);
--p-inputswitch-handle-hover-background: var(--p-zinc-950);
--p-inputswitch-handle-checked-background: var(--p-zinc-950);
--p-inputswitch-handle-checked-hover-background: var(--p-zinc-950);
}
2023-02-28 08:29:30 +00:00
</style>