feat: add basic Variables.

This commit is contained in:
Zhang Dian
2025-01-01 21:52:24 +08:00
parent c22211df24
commit 1fe4df3716
4 changed files with 76 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
<Styles xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:semi="https://irihi.tech/semi">
<Styles.Resources>
<ResourceDictionary>
@@ -14,6 +15,7 @@
<ResourceInclude Source="avares://Semi.Avalonia/Controls/_index.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Base.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Shared/_index.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Tokens/Variables.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Locale/zh-cn.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Icons/_index.axaml" />
</ResourceDictionary.MergedDictionaries>

View File

@@ -1,4 +1,6 @@
<Styles x:Class="Semi.Avalonia.SemiTheme" xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
<Styles x:Class="Semi.Avalonia.SemiTheme"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:semi="https://irihi.tech/semi">
<Styles.Resources>
<ResourceDictionary>
@@ -14,6 +16,7 @@
<ResourceInclude Source="avares://Semi.Avalonia/Controls/_index.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Base.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Shared/_index.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Tokens/Variables.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Locale/zh-cn.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Icons/_index.axaml" />
</ResourceDictionary.MergedDictionaries>

View File

@@ -0,0 +1,64 @@
<ResourceDictionary
x:Class="Semi.Avalonia.Tokens.Variables"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- Sizing -->
<x:Double x:Key="SemiHeightControlSmall">24</x:Double> <!-- 表单项高度 - 小尺寸 -->
<x:Double x:Key="SemiHeightControlDefault">32</x:Double> <!-- 表单项高度 - 默认尺寸 -->
<x:Double x:Key="SemiHeightControlLarge">40</x:Double> <!-- 表单项高度 - 大尺寸 -->
<x:Double x:Key="SemiWidthIconExtraSmall">8</x:Double> <!-- 图标尺寸 - 超小 -->
<x:Double x:Key="SemiWidthIconSmall">12</x:Double> <!-- 图标尺寸 - 小 -->
<x:Double x:Key="SemiWidthIconMedium">16</x:Double> <!-- 图标尺寸 - 中 -->
<x:Double x:Key="SemiWidthIconLarge">20</x:Double> <!-- 图标尺寸 - 大 -->
<x:Double x:Key="SemiWidthIconExtraLarge">24</x:Double> <!-- 图标尺寸 - 超大 -->
<!-- Border -->
<x:Double x:Key="SemiBorderSpacing">0</x:Double> <!-- 描边间距 - 零 -->
<x:Double x:Key="SemiBorderSpacingControl">1</x:Double> <!-- 描边间距 - 默认状态 -->
<x:Double x:Key="SemiBorderSpacingControlFocus">1</x:Double> <!-- 描边间距 - focus 状态 -->
<Thickness x:Key="SemiBorderThickness">0</Thickness> <!-- 描边宽度 - 零 -->
<Thickness x:Key="SemiBorderThicknessControl">1</Thickness> <!-- 描边宽度 - 默认状态 -->
<Thickness x:Key="SemiBorderThicknessControlFocus">1</Thickness> <!-- 描边宽度 - focus 状态 -->
<CornerRadius x:Key="SemiBorderRadiusExtraSmall">3</CornerRadius> <!-- 圆角 - 超小 -->
<CornerRadius x:Key="SemiBorderRadiusSmall">3</CornerRadius> <!-- 圆角 - 小 -->
<CornerRadius x:Key="SemiBorderRadiusMedium">6</CornerRadius> <!-- 圆角 - 中 -->
<CornerRadius x:Key="SemiBorderRadiusLarge">12</CornerRadius> <!-- 圆角 - 大 -->
<CornerRadius x:Key="SemiBorderRadiusFull">999</CornerRadius> <!-- 圆角 - 全圆 -->
<!-- Spacing -->
<x:Double x:Key="SemiSpacingNone">0</x:Double> <!-- 间距 - 零 -->
<x:Double x:Key="SemiSpacingSuperTight">2</x:Double> <!-- 间距 - 极紧凑 -->
<x:Double x:Key="SemiSpacingExtraTight">4</x:Double> <!-- 间距 - 超紧凑 -->
<x:Double x:Key="SemiSpacingTight">8</x:Double> <!-- 间距 - 紧凑 -->
<x:Double x:Key="SemiSpacingBaseTight">12</x:Double> <!-- 间距 - 偏紧凑 -->
<x:Double x:Key="SemiSpacingBase">16</x:Double> <!-- 间距 - 默认 -->
<x:Double x:Key="SemiSpacingBaseLoose">20</x:Double> <!-- 间距 - 偏宽松 -->
<x:Double x:Key="SemiSpacingLoose">24</x:Double> <!-- 间距 - 宽松 -->
<x:Double x:Key="SemiSpacingExtraLoose">32</x:Double> <!-- 间距 - 超宽松 -->
<x:Double x:Key="SemiSpacingSuperLoose">40</x:Double> <!-- 间距 - 极宽松 -->
<!-- Thickness -->
<Thickness x:Key="SemiThicknessNone">0</Thickness> <!-- 宽度 - 零 -->
<Thickness x:Key="SemiThicknessSuperTight">2</Thickness> <!-- 宽度 - 极紧凑 -->
<Thickness x:Key="SemiThicknessExtraTight">4</Thickness> <!-- 宽度 - 超紧凑 -->
<Thickness x:Key="SemiThicknessTight">8</Thickness> <!-- 宽度 - 紧凑 -->
<Thickness x:Key="SemiThicknessBaseTight">12</Thickness> <!-- 宽度 - 偏紧凑 -->
<Thickness x:Key="SemiThicknessBase">16</Thickness> <!-- 宽度 - 默认 -->
<Thickness x:Key="SemiThicknessBaseLoose">20</Thickness> <!-- 宽度 - 偏宽松 -->
<Thickness x:Key="SemiThicknessLoose">24</Thickness> <!-- 宽度 - 宽松 -->
<Thickness x:Key="SemiThicknessExtraLoose">32</Thickness> <!-- 宽度 - 超宽松 -->
<Thickness x:Key="SemiThicknessSuperLoose">40</Thickness> <!-- 宽度 - 极宽松 -->
<!-- Font -->
<x:Double x:Key="SemiFontSizeSmall">12</x:Double> <!-- 小文本字号 -->
<x:Double x:Key="SemiFontSizeRegular">14</x:Double> <!-- 常规文本字号 -->
<x:Double x:Key="SemiFontSizeHeader6">16</x:Double> <!-- 六级标题字号 -->
<x:Double x:Key="SemiFontSizeHeader5">18</x:Double> <!-- 五级标题字号 -->
<x:Double x:Key="SemiFontSizeHeader4">20</x:Double> <!-- 四级标题字号 -->
<x:Double x:Key="SemiFontSizeHeader3">24</x:Double> <!-- 三级标题字号 -->
<x:Double x:Key="SemiFontSizeHeader2">28</x:Double> <!-- 二级标题字号 -->
<x:Double x:Key="SemiFontSizeHeader1">32</x:Double> <!-- 一级标题字号 -->
<FontWeight x:Key="SemiFontWeightLight">200</FontWeight> <!-- 字重 - 轻 -->
<FontWeight x:Key="SemiFontWeightRegular">400</FontWeight> <!-- 字重 - 常规 -->
<FontWeight x:Key="SemiFontWeightBold">600</FontWeight> <!-- 字重 - 粗 -->
</ResourceDictionary>

View File

@@ -0,0 +1,5 @@
using Avalonia.Controls;
namespace Semi.Avalonia.Tokens;
public class Variables : ResourceDictionary;