primevue-mirror/doc/theming/ScopedCSSDoc.vue

64 lines
2.2 KiB
Vue
Raw Normal View History

2023-02-28 08:29:30 +00:00
<template>
<DocSectionText v-bind="$attrs">
<p>Scoped CSS allows overriding the styles of a particular PrimeVue component using <i>scoped</i> SFC style and <i>:deep</i>.</p>
2023-02-28 08:29:30 +00:00
</DocSectionText>
<div class="card">
<Panel header="Scoped Panel">
2023-02-28 08:29:30 +00:00
<p class="m-0">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
</Panel>
</div>
2024-01-30 08:16:35 +00:00
<DocSectionCode :code="code1" hideToggleCode importCode hideStackBlitz />
<DocSectionCode :code="code2" hideToggleCode hideStackBlitz />
2023-02-28 08:29:30 +00:00
</template>
<script>
export default {
data() {
return {
code1: {
2023-09-22 12:54:14 +00:00
basic: `
<style scoped>
:deep(.p-panel .p-panel-header) {
background-color: var(--teal-500);
border-color: var(--teal-500);
2023-02-28 08:29:30 +00:00
color: #ffffff;
}
:deep(.p-panel .p-panel-content) {
border-color: var(--teal-500);
}
2023-02-28 08:29:30 +00:00
</style>
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: `
<template>
<Panel header="Scoped Panel">
2023-02-28 08:29:30 +00:00
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</Panel>
2023-10-15 09:38:39 +00:00
</template>
`
2023-02-28 08:29:30 +00:00
}
};
}
};
</script>
<style scoped>
:deep(.p-panel .p-panel-header) {
background-color: var(--teal-500);
border-color: var(--teal-500);
2023-02-28 08:29:30 +00:00
color: #ffffff;
}
:deep(.p-panel .p-panel-content) {
border-color: var(--teal-500);
}
2023-02-28 08:29:30 +00:00
</style>