Border
我们对边框进行统一规范,可用于按钮、卡片、弹窗等组件里。
边框
我们提供了以下几种边框样式,以供选择。
Name | Thickness | Demo |
Solid | 1px | |
Dashed | 2px |
<template>
<table class="demo-border">
<tbody>
<tr>
<td class="text">Name</td>
<td class="text">Thickness</td>
<td class="line">Demo</td>
</tr>
<tr>
<td class="text">Solid</td>
<td class="text">1px</td>
<td class="line">
<div />
</td>
</tr>
<tr>
<td class="text">Dashed</td>
<td class="text">2px</td>
<td class="line">
<div class="dashed" />
</td>
</tr>
</tbody>
</table>
</template>
<style scoped>
.demo-border .text {
width: 15%;
}
.demo-border .line {
width: 70%;
}
.demo-border .line div {
width: 100%;
height: 0;
border-top: 1px solid var(--s-border-color);
}
.demo-border .line .dashed {
border-top: 2px dashed var(--s-border-color);
}
</style>
圆角
我们提供了以下几种圆角样式,以供选择。
投影
我们提供了以下几种投影样式,以供选择。
Basic Shadow
--s-box-shadow
Light Shadow
--s-box-shadow-light
Lighter Shadow
--s-box-shadow-lighter
Dark Shadow
--s-box-shadow-dark
<template>
<div class="flex justify-between items-center flex-nowrap">
<div
v-for="(shadow, i) in shadowGroup"
:key="i"
class="flex flex-col justify-center items-center"
m="auto"
w="46"
>
<div
class="inline-flex"
h="30"
w="30"
m="2"
:style="{
boxShadow: `var(${getCssVarName(shadow.type)})`,
}"
/>
<span p="y-4" class="demo-shadow-text" text="sm">
{{ shadow.name }}
</span>
<code text="xs">
{{ getCssVarName(shadow.type) }}
</code>
</div>
</div>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
const shadowGroup = ref([
{
name: 'Basic Shadow',
type: '',
},
{
name: 'Light Shadow',
type: 'light',
},
{
name: 'Lighter Shadow',
type: 'lighter',
},
{
name: 'Dark Shadow',
type: 'dark',
},
])
const getCssVarName = (type: string) => {
return `--s-box-shadow${type ? '-' : ''}${type}`
}
</script>