<script setup lang="ts">
import { ref } from 'vue'
import { BrContainer, BrConfigProvider, BrButton } from '@breezeui/vue'
const currentSizing = ref({
md: { paddingX: '1rem', width: '768px' },
lg: { paddingX: '2rem', width: '1024px' }
})
const toggleSizing = () => {
if (currentSizing.value.md.paddingX === '1rem') {
currentSizing.value = {
md: { paddingX: '3rem', width: '600px' },
lg: { paddingX: '4rem', width: '800px' }
}
} else {
currentSizing.value = {
md: { paddingX: '1rem', width: '768px' },
lg: { paddingX: '2rem', width: '1024px' }
}
}
}
</script>
<template>
<div class="space-y-4">
<div class="flex gap-2">
<BrButton @click="toggleSizing">Toggle global size config</BrButton>
</div>
<BrConfigProvider :sizing="currentSizing">
<div class="w-full bg-muted/30 p-4 rounded-md space-y-4">
<BrContainer max-width="md" padding="md" class="bg-primary/10 border border-primary/20 py-4 rounded-md transition-all duration-300">
<p class="text-center text-primary font-medium">Use MD Container for size variables</p>
<p class="text-center text-sm text-primary/80 mt-2">
Current padding-x: {{ currentSizing.md.paddingX }} <br>
Overridden --br-px-md Variable
</p>
</BrContainer>
<BrContainer max-width="lg" padding="lg" class="bg-secondary border border-border py-4 rounded-md transition-all duration-300">
<p class="text-center text-secondary-foreground font-medium">Use LG Container for size variables</p>
<p class="text-center text-sm text-secondary-foreground/80 mt-2">
Current padding-x: {{ currentSizing.lg.paddingX }} <br>
Overridden --br-px-lg Variable
</p>
</BrContainer>
<BrContainer class="bg-destructive/10 border border-destructive/20 py-4 rounded-md !px-0">
<p class="text-center text-destructive font-medium">Local override style</p>
<p class="text-center text-sm text-destructive/80 mt-2">Use TailwindCSS of !px-0 Force override padding</p>
</BrContainer>
</div>
</BrConfigProvider>
</div>
</template>