console.log("行号从5开始");
console.log("下一行是6");def func():
a = 1
b = 2 # 高亮此行
c = 3
d = 4 # 高亮此行及下两行
e = 5
f = 6<div> 两个空格 </div>
→ 一个制表符我们先从主文件说起,打开这个文件,首先看到的是注释:
/**
* 这是typecho系统的一套默认皮肤。你可以在<a href="http://typecho.org">typecho的官方网站</a>获得更多关于此皮肤的信息
*
* @package Typecho Default Theme
* @author typecho
* @version 1.0.0
* @link http://typecho.org
*/这是模板信息存放的地方,它将在后台的模板选择页显示。前两行是简短的介绍,每个“*”表示一个段落。
紧挨着注释下方的$this->need('header.php'),在结尾处也会看到$this->need('sidebar.php')和$this->need('footer.php')。这些语句用来调用模板的其它模块。header故名思议是页首,sidebar是侧栏,footer是页脚。(与php的include功能差不多,need是typecho程序内置的方法,内部还会存在一些判断什么的,建议在做主题是使用need方法而不是include)
<?php if ($this->have()): ?>
<?php while($this->next()): ?>
<a href="<?php $this->permalink() ?>"><?php $this->title() ?></a>
作者:<a href="<?php $this->author->permalink(); ?>"><?php $this->author(); ?></a>
时间: <?php $this->date(); ?>
分类: <?php $this->category(','); ?>
<a href="<?php $this->permalink() ?>#comments"><?php $this->commentsNum('评论', '1 条评论', '%d 条评论'); ?>
标签:<?php $this->tags(','); ?>
<?php $this->content('- 阅读剩余部分 -'); ?>
<?php endwhile; ?>
<?php else: ?>暂无文章<?php endif; ?>进入文章循环,输出文章,一句一句介绍
| 代码 | 解释 |
|---|---|
<?php if ($this->have()): ?> | 判断是否有文章,没有的话输出提示 |
<?php while($this->next()): ?> | 开始循环输出文章,与<?php endwhile; ?>对应 |
<?php $this->permalink() ?> | 文章所在的连接 |
<?php $this->title() ?> | 文章标题 |
<?php $this->author(); ?> | 文章作者 |
<?php $this->author->permalink(); ?> | 文章作者地址 |
<?php $this->date(); ?> | 文章的发布日期,日期格式可在typecho后台设置->阅读中设置 |
<?php $this->category(','); ?> | 文章所在分类 |
<?php $this->tags(','); ?> | 文章标签 |
<?php $this->commentsNum('评论', '1 条评论', '%d 条评论'); ?> | 文章评论数及连接 |
<?php $this->content('- 阅读剩余部分 -'); ?> | 文章内容,其中的“- 阅读剩余部分 -”是显示摘要时隐藏部分的邀请链接,也可使用<?php $this->excerpt(140, '...'); ?>来进行自动截取文字内容,“140”是截取字符数量 |
<?php $this->pageNav('«前一页', '后一页»'); ?>也可以这样分开写
<?php $this->pageLink('下一页','next'); ?>
<?php $this->pageLink('上一页'); ?>archive.php代码同index.php,区别就是index.php是显示首页的,而archive.php是显示某分类下的文章列表、搜索结果的。如果模板文件中不存在archive.php,程序就会自动用index.php代替archive.php。
打开这个文件,见到的第一个php代码就是:
<meta charset="<?php $this->options->charset(); ?>">调用默认的编码,现在最经常用都是utf-8吧。所以我通常是直接写成utf-8,省去php处理时间。
<?php $this->archiveTitle(array(
'category' => _t('分类 %s 下的文章'),
'search' => _t('包含关键字 %s 的文章'),
'tag' => _t('标签 %s 下的文章'),
'author' => _t('%s 发布的文章')
), '', ' - '); ?><?php $this->options->title(); ?><?php $this->archiveTitle(); ?>是当前页面的标题,<?php $this->options->title(); ?>是网站的标题。
<link rel="stylesheet" href="<?php $this->options->themeUrl('style.css'); ?>">其中style.css是样式表文件相对模板目录的路径和文件名。
<?php $this->header(); ?>这是typecho的自有函数,会输出HTML头部信息;同时这个也是头部插件接口,有了它插件可以向网站头部插入css或者js代码。
<?php if ($this->options->logoUrl): ?>
<a id="logo" href="<?php $this->options->siteUrl(); ?>">
<img src="<?php $this->options->logoUrl() ?>" alt="<?php $this->options->title() ?>" />
</a>
<?php else: ?>
<a id="logo" href="<?php $this->options->siteUrl(); ?>"><?php $this->options->title() ?></a>
<p class="description"><?php $this->options->description() ?></p>
<?php endif; ?>第一句的if判断是判断模板是否通过模板设置设置了logo的地址,如果设置了就显示logo图片,否则就显示博客标题。<?php $this->options->siteUrl(); ?>是网站地址<?php $this->options->title() ?>是网站名字<?php $this->options->description() ?>是网站描述。
logo部分的讲解将会在functions.php章节中详细讲解。
<form id="search" method="post" action="<?php $this->options->siteUrl(); ?>" role="search">
<input type="text" id="s" name="s" class="text" placeholder="<?php _e('输入关键字搜索'); ?>" />
<button type="submit" class="submit"><?php _e('搜索'); ?></button>
</form>当你的文章很多很多,这个搜索就必不可少。
<?php if ($this->have()): ?>
<?php while($this->next()): ?>
<a href="<?php $this->permalink() ?>"><?php $this->title() ?></a>
作者:<a href="<?php $this->author->permalink(); ?>"><?php $this->author(); ?></a>
时间: <?php $this->date(); ?>
分类: <?php $this->category(','); ?>
<a href="<?php $this->permalink() ?>#comments"><?php $this->commentsNum('评论', '1 条评论', '%d 条评论'); ?>
标签:<?php $this->tags(','); ?>
<?php $this->content('- 阅读剩余部分 -'); ?>
<?php endwhile; ?>
<?php else: ?>暂无文章<?php endif; ?>0其中<?php $this->options->siteUrl(); ?>是网站地址,然后下面的while循环是循环输出独立页面的,其中<?php $pages->permalink(); ?>是独立页面的超链接,<?php $pages->title(); ?>是独立页面的标题。
<?php if ($this->have()): ?>
<?php while($this->next()): ?>
<a href="<?php $this->permalink() ?>"><?php $this->title() ?></a>
作者:<a href="<?php $this->author->permalink(); ?>"><?php $this->author(); ?></a>
时间: <?php $this->date(); ?>
分类: <?php $this->category(','); ?>
<a href="<?php $this->permalink() ?>#comments"><?php $this->commentsNum('评论', '1 条评论', '%d 条评论'); ?>
标签:<?php $this->tags(','); ?>
<?php $this->content('- 阅读剩余部分 -'); ?>
<?php endwhile; ?>
<?php else: ?>暂无文章<?php endif; ?>1获取最新的10篇文章标题,得到的html是
<?php if ($this->have()): ?>
<?php while($this->next()): ?>
<a href="<?php $this->permalink() ?>"><?php $this->title() ?></a>
作者:<a href="<?php $this->author->permalink(); ?>"><?php $this->author(); ?></a>
时间: <?php $this->date(); ?>
分类: <?php $this->category(','); ?>
<a href="<?php $this->permalink() ?>#comments"><?php $this->commentsNum('评论', '1 条评论', '%d 条评论'); ?>
标签:<?php $this->tags(','); ?>
<?php $this->content('- 阅读剩余部分 -'); ?>
<?php endwhile; ?>
<?php else: ?>暂无文章<?php endif; ?>2具体显示数量可在typecho后台设置->阅读中设置。
<?php if ($this->have()): ?>
<?php while($this->next()): ?>
<a href="<?php $this->permalink() ?>"><?php $this->title() ?></a>
作者:<a href="<?php $this->author->permalink(); ?>"><?php $this->author(); ?></a>
时间: <?php $this->date(); ?>
分类: <?php $this->category(','); ?>
<a href="<?php $this->permalink() ?>#comments"><?php $this->commentsNum('评论', '1 条评论', '%d 条评论'); ?>
标签:<?php $this->tags(','); ?>
<?php $this->content('- 阅读剩余部分 -'); ?>
<?php endwhile; ?>
<?php else: ?>暂无文章<?php endif; ?>3获取最新的10个回复,得到的html是
<?php if ($this->have()): ?>
<?php while($this->next()): ?>
<a href="<?php $this->permalink() ?>"><?php $this->title() ?></a>
作者:<a href="<?php $this->author->permalink(); ?>"><?php $this->author(); ?></a>
时间: <?php $this->date(); ?>
分类: <?php $this->category(','); ?>
<a href="<?php $this->permalink() ?>#comments"><?php $this->commentsNum('评论', '1 条评论', '%d 条评论'); ?>
标签:<?php $this->tags(','); ?>
<?php $this->content('- 阅读剩余部分 -'); ?>
<?php endwhile; ?>
<?php else: ?>暂无文章<?php endif; ?>4其中<?php $comments->excerpt(35, '...'); ?>,“35”代表要回复内容截取的字的个数,“…”代表省略的意思,你可以自行修改。具体显示数量可在typecho后台设置->评论中设置。
<?php if ($this->have()): ?>
<?php while($this->next()): ?>
<a href="<?php $this->permalink() ?>"><?php $this->title() ?></a>
作者:<a href="<?php $this->author->permalink(); ?>"><?php $this->author(); ?></a>
时间: <?php $this->date(); ?>
分类: <?php $this->category(','); ?>
<a href="<?php $this->permalink() ?>#comments"><?php $this->commentsNum('评论', '1 条评论', '%d 条评论'); ?>
标签:<?php $this->tags(','); ?>
<?php $this->content('- 阅读剩余部分 -'); ?>
<?php endwhile; ?>
<?php else: ?>暂无文章<?php endif; ?>5效果如下
<?php if ($this->have()): ?>
<?php while($this->next()): ?>
<a href="<?php $this->permalink() ?>"><?php $this->title() ?></a>
作者:<a href="<?php $this->author->permalink(); ?>"><?php $this->author(); ?></a>
时间: <?php $this->date(); ?>
分类: <?php $this->category(','); ?>
<a href="<?php $this->permalink() ?>#comments"><?php $this->commentsNum('评论', '1 条评论', '%d 条评论'); ?>
标签:<?php $this->tags(','); ?>
<?php $this->content('- 阅读剩余部分 -'); ?>
<?php endwhile; ?>
<?php else: ?>暂无文章<?php endif; ?>6如果有个分类3,分类4是上述分类2的子分类,那么效果如下
<?php if ($this->have()): ?>
<?php while($this->next()): ?>
<a href="<?php $this->permalink() ?>"><?php $this->title() ?></a>
作者:<a href="<?php $this->author->permalink(); ?>"><?php $this->author(); ?></a>
时间: <?php $this->date(); ?>
分类: <?php $this->category(','); ?>
<a href="<?php $this->permalink() ?>#comments"><?php $this->commentsNum('评论', '1 条评论', '%d 条评论'); ?>
标签:<?php $this->tags(','); ?>
<?php $this->content('- 阅读剩余部分 -'); ?>
<?php endwhile; ?>
<?php else: ?>暂无文章<?php endif; ?>7<?php if ($this->have()): ?>
<?php while($this->next()): ?>
<a href="<?php $this->permalink() ?>"><?php $this->title() ?></a>
作者:<a href="<?php $this->author->permalink(); ?>"><?php $this->author(); ?></a>
时间: <?php $this->date(); ?>
分类: <?php $this->category(','); ?>
<a href="<?php $this->permalink() ?>#comments"><?php $this->commentsNum('评论', '1 条评论', '%d 条评论'); ?>
标签:<?php $this->tags(','); ?>
<?php $this->content('- 阅读剩余部分 -'); ?>
<?php endwhile; ?>
<?php else: ?>暂无文章<?php endif; ?>8输出:
<?php if ($this->have()): ?>
<?php while($this->next()): ?>
<a href="<?php $this->permalink() ?>"><?php $this->title() ?></a>
作者:<a href="<?php $this->author->permalink(); ?>"><?php $this->author(); ?></a>
时间: <?php $this->date(); ?>
分类: <?php $this->category(','); ?>
<a href="<?php $this->permalink() ?>#comments"><?php $this->commentsNum('评论', '1 条评论', '%d 条评论'); ?>
标签:<?php $this->tags(','); ?>
<?php $this->content('- 阅读剩余部分 -'); ?>
<?php endwhile; ?>
<?php else: ?>暂无文章<?php endif; ?>9<?php $this->pageNav('«前一页', '后一页»'); ?>0这些是可有可无的,只是为了方便登录登出。<?php $this->options->adminUrl(); ?>是后台地址,<?php $this->user->screenName(); ?>用户昵称,<?php $this->options->logoutUrl(); ?>登出链接,<?php $this->options->adminUrl('login.php'); ?>登陆链接。
<?php $this->pageNav('«前一页', '后一页»'); ?>1页脚文件,推荐大家把一些较大的js放在这个文件中最后载入,不会影响阅读。看看我们的footer要讲解些什么?
<?php $this->pageNav('«前一页', '后一页»'); ?>2<?php echo date('Y'); ?>是当前年份<?php $this->options->siteUrl(); ?>是网站地址<?php $this->options->title(); ?>是网站标题。<?php $this->pageNav('«前一页', '后一页»'); ?>3用于插件向页脚插入css,js文件等。
post页和index是差不多的,下面解释下post.php里面存在的php代码。
| 代码 | 解释 |
|---|---|
<?php $this->permalink() ?> | 文章地址 |
<?php $this->title() ?> | 文章标题 |
<?php $this->author->permalink(); ?> | 文章作者主页链接 |
<?php $this->author(); ?> | 文章作者昵称 |
<?php $this->date(); ?> | 文章发布时间 |
<?php $this->category(','); ?> | 文章分类,多个分类中间用逗号隔开 |
<?php $this->content(); ?> | 文章内容 |
<?php $this->tags(', ', true, 'none'); ?> | 文章标签,多个标签间用逗号隔开,标签以带超链接的形式显示,如果不存在标签则显示none |
<?php $this->need('comments.php'); ?> | 调用评论页 |
<?php $this->thePrev('%s','没有了'); ?> | 带有超链接的上一篇文章的标题 |
<?php $this->theNext('%s','没有了'); ?> | 带有超链接的下一篇文章的标题 |
page.php代码同post.php,区别就是post是用来显示文章的,而page.php是用来显示独立页面的。
<?php $this->pageNav('«前一页', '后一页»'); ?>4判断文章是否存在评论,如果存在就输出评论;其中<?php $comments->listComments(); ?>是评论列表,<?php $comments->pageNav('« 前一页', '后一页 »'); ?>是评论翻页按钮。
<?php $this->pageNav('«前一页', '后一页»'); ?>5具体请对应上述代码中注释自行理解。
function themeConfig($form) 内的代码是模板设置功能
<?php $this->pageNav('«前一页', '后一页»'); ?>6这行代码就是在模板设置处添加一个logo设置,可以添加一个图片地址作为logo,添加好了通过如下代码即可输出这个图片
<?php $this->pageNav('«前一页', '后一页»'); ?>7此处对应header.php中的logo显示。
<?php $this->pageNav('«前一页', '后一页»'); ?>8是一些开关,这里拿ShowCategory举例,如果勾选他
<?php $this->pageNav('«前一页', '后一页»'); ?>9这里对应的是sidebar.php中的最新文章,最新评论,文章分类,归档等显示开关。
参考以上代码,照葫芦画瓢,可以增加自己需要的模板设置。
| 文件名 | 作用 | 必须 |
|---|---|---|
| style.css | 主题样式文件 | 否 |
| screenshot.png | 主题缩略图,图片后缀支持jpg,png,gif,bmp,jpeg | 否 |
| index.php | 首页以及说明文件 | 是 |
| 404.php | 404页面文件 | 否 |
| archive.php | 通用(分类、搜索、标签、作者)页面文件 | 否 |
| category.php | 分类页面文件 | 否 |
| search.php | 搜索页面文件 | 否 |
| tag.php | 标签页面文件 | 否 |
| author.php | 作者页面文件 | 否 |
| comments.php | 评论页面文件 | 否 |
| footer.php | 底部页面文件 | 否 |
| functions.php | 主题函数文件 | 否 |
| header.php | 头部页面文件 | 否 |
| page.php | 独立页面文件 | 否 |
| post.php | 日志页面文件 | 否 |
| sidebar.php | 侧边栏页面文件 | 否 |
PS:
如果archive.php不存在,index.php也会作为通用页面,实现archive.php的工作。
“姑娘醒了?”一个梳着双丫髻的小姑娘端着铜盆进来,见她睁眼,喜得差点摔了盆子,“快去禀报公子,林姑娘醒了!”
林晚脑子嗡嗡作响,昨晚她还在医学院的解剖室熬夜复习,为了赶早八的药理课在桌上趴着睡了过去,怎么一睁眼就到了这古色古香的地方?铜镜里映出张陌生的脸庞,柳叶眉杏核眼,一身淡青色襦裙衬得肌肤胜雪,只是脸色苍白得厉害。
“姑娘可是还有不适?”温润的男声自身后响起。林晚回头,见一年轻男子立在门口,青衫广袖,腰间系着玉带,面容清俊如月下寒松。他身后跟着的老郎中刚要搭脉,却被林晚下意识躲开——她清楚自己没病,更怕这古代医术误诊。
“我没事,只是有些乏力。”林晚斟酌着开口,努力模仿着记忆里的古言腔调,“多谢公子搭救。”她从丫鬟零碎的话语中得知,自己是被这名叫沈砚之的吏部侍郎从曲江池边救回来的,原主不知为何落水,她一睁眼就占了这具身体。
沈砚之刚要说话,院外突然传来急促的呼救声。“公子!老夫人突发恶疾,晕过去了!”管家跌跌撞撞地跑来,脸色惨白。
府里的郎中匆忙赶到,诊脉后却面色凝重地摇头:“老夫人脉息微弱,似是痰迷心窍,老夫无能为力啊。”沈砚之脸色骤变,林晚心头一动——痰迷心窍,莫不是急性脑梗或心梗?她虽未正式行医,但急救知识烂熟于心。
“公子,或许我能试试。”林晚上前一步,声音虽轻却坚定。沈砚之眼中闪过诧异,却在看到她眼中的笃定后,咬牙点头:“若能救祖母,沈某愿以百金相赠。”
林晚让丫鬟取来烈酒和干净的布巾,又让人按住老夫人的四肢,自己则跪在榻边,双手交叠按在老夫人胸口,开始做胸外按压。这古怪的动作让在场众人惊呼,沈砚之也皱紧了眉,却强忍着没阻止。
按压持续了一炷香的时间,林晚额角沁满汗珠,手臂酸痛得几乎抬不起来。就在众人以为她疯了的时候,老夫人突然剧烈咳嗽起来,一口浓痰吐了出来,缓缓睁开了眼睛。
“祖母!”沈砚之喜极而泣,转头看向林晚,眼中满是敬佩与好奇。老夫人缓过神后,拉着林晚的手连连道谢。
当晚,沈砚之亲自送来伤药和点心。烛火摇曳中,他看着林晚缠着纱布的手腕,轻声问:“姑娘的医术,当真奇特。”林晚心头一紧,编了个自幼随隐世神医学艺的借口。
沈砚之却没追问,只是递过一只玉簪:“这是家母遗物,望姑娘笑纳。若不嫌弃,便在府中安心住下,也好让我尽地主之谊。”玉簪触手温润,雕着一朵盛放的玉兰花。
林晚看着他眼中的真诚,轻轻点头。窗外,长安的月光透过窗棂洒进来,落在两人身上。她忽然觉得,这陌生的大唐,或许会有不一样的缘分在等着她。
]]>=================================================
强烈建议开发者认真阅读本文档,掌握md及HBuilderX对md的强大支持。
窄屏幕下,可按Alt+滚轮横向滚动
很多人只把markdown用于网络文章发表,这糟蹋了markdown。
markdown不止是HTML的简化版,更重要的是txt的升级版、word的轻量版、笔记的最佳载体。
作为一种简单的格式标记语言,不同于txt的无格式,不同于HTML的复杂标记,也不同于word的鼠标调整样式。markdown通过简单的几个字符键入,就可以快捷的定义文档的样式。
比如在行首敲一个“#”,就把这行定义为了1级标题,并且在HBuilderX里有直观完善的着色,这样无需发布为web页面,可直接当word用。
掌握markdown,你可以完全抛弃txt和笔记软件的编辑器,并且在大多数场景下替代掉复杂臃肿的word。享受简洁之美、享受效率提升。
而HBuilderX,可以被称为最强大的markdown书写工具了。
下面的示例列举了markdown语法及对应的HBuilderX使用技巧:
开始前,可以先按下文档结构图的快捷键Alt+w(Mac是Ctrl+w),浏览本文的大纲。
markdown的标题是行首以#号开头,空格分割的,不同级别的标题,在HX里着色也不同。如下:
标题使用技巧:
折叠:
markdown的列表支持有序列表、无序列表以及特殊的任务列表。
同样也是在行前加一个特殊符号,并空格后再跟列表文字内容。
有序列表就是有顺序的列表,依靠行前的数字标记顺序。
无序列表就是列表不排序,无序列表因书写随意而被更广泛的使用。
无序列表有3种前缀,HX里分别用于表示1级列表、2级列表、3级列表。
无序列表2
任务列表非常实用,管理待办、已办非常便利。
[x] 任务列表-已完成任务 【快捷键:Ctrl+Alt+]】
以上三种列表,均支持批量修改列表符,有如下方式建议依次学习尝试:
引用1
引用2
快捷键:Ctrl+Alt+Shift+.
智能双击:双击>号可选中整段引用列表
智能回车:行尾回车或行中Ctrl+Enter强制换行后会自动续列表;连续按回车会清除列表符;在列表符后回车或行尾Shift+回车,上一行留出列表符
加粗 【快捷键:Ctrl+B,支持多光标;Emmet:b后敲Tab】
加粗2
_倾斜_【Emmet:i后敲Tab;前后包围:选中文字按Ctrl+\是在选区两侧添加光标,可以继续输入_】
倾斜删除线 单行代码
包围插入:先选中文字内容,然后按_*~`等符号,会自动在2侧加包围
智能双击:双击语法区前面的定义符号,选中包含定义符的整段文字
去包围:选中整段文字后,按Ctrl+Shift+],可去除2侧包围符号
引号括号虽然不属于markdown语法,但也支持相同的包围、选择、去包围操作。
引号括号智能双击选择时略特殊的是:双击引号括号内侧,选中引号括号里的内容(不含引号括号);按下Alt+双击引号括号内侧,则选中包含符号的整段文字
HBuilderX还支持以下对2侧文本高效处理的手段

------------- 【Emmet:hr后敲Tab】
=============
var a = documentEmmet:code后敲Tab,行首生效
智能双击:双击语法区开头,即!左侧,选中包含定义符的整段文字
支持代码直接高亮着色,这应该是只有HBuilderX才有的功能。注意需要在代码区开头指定语言类型
快捷键:Ctrl+/
智能双击:双击注释首尾的定义符,选中整段注释
day后敲Tab,当前日期。注意day需在行首或前面有空格
time后敲Tab,当前时间。注意time需在行首或前面有空格
文章很长时,word里有文档结构图,HBuilderX也有。
菜单视图-文档结构图,快捷键Alt+W(mac是ctrl+W),轻松管理长文档
对md文件点工具栏或菜单里的浏览器运行,可以使用外部浏览器预览此md文件,会自动渲染为HTML。
点右上角的预览【快捷键Alt+p】,可在HBuilderX右侧预览该md文档的HTML渲染结果。
在浏览器中点打印,选择打印到PDF,可将md输出为PDF格式。(注意在打印选项里去掉页眉页脚)
markdown拥有迷人的输入体验,但分享并不方便,尤其是缺少免费、稳定、高速的图床。
uniCloud提供了免费、稳定、高速的服务器和cdn。
HBuilderX,基于uniCloud,提供了markdown的一键分享功能。
利用uniCloud的前端网页托管,将markdown稳定转成了HTML网页,并发布为在线的URL。您可以把URL发送给任何想要分享的人。
同时markdown里涉及的图片也会自动上传到前端网页托管里免费cdn中。
更多见: MarkDown一键分享使用说明
删除
选择
查找
都学会了吗?
markdown语法其实很简单,认真学半小时就能掌握。
本框架是一个功能完整的 CSS 工具集,提供了全面的样式解决方案,包括:
框架设计遵循 "移动优先" 原则,通过清晰的命名规范和模块化结构,使开发者能够快速构建一致、美观的界面。
引入框架
将框架 CSS 文件引入到 HTML 文档的<head>中:
\<link rel="stylesheet" href="path/to/enhanced-css-framework.css">基础结构
一个典型的页面结构如下:
\<!DOCTYPE html>
\<html lang="zh-CN">
\<head>
  \<meta charset="UTF-8">
  \<meta name="viewport" content="width=device-width, initial-scale=1.0">
  \<title>框架示例\</title>
  \<link rel="stylesheet" href="path/to/enhanced-css-framework.css">
\</head>
\<body class="bg-background">
  \<div class="container">
  \<div class="row">
  \<div class="col-md-6">
  \<!-- 内容 -->
  \</div>
  \<div class="col-md-6">
  \<!-- 内容 -->
  \</div>
  \</div>
  \</div>
\</body>
\</html>框架使用 CSS 变量(Custom Properties)定义全局样式,所有变量都在:root选择器下声明,便于统一修改和主题定制。
\--color-primary: #007BFF; /\* 主色调 \*/
\--color-primary-light: #3395FF; /\* 主色浅变体 \*/
\--color-primary-dark: #0056D2; /\* 主色深变体 \*/
\--color-primary-transparent: rgba(0, 123, 255, 0.15); /\* 主色透明变体 \*/
\--color-primary-rgb: 0, 123, 255; /\* 主色RGB值(用于rgba计算) \*/
\--color-secondary: #444; /\* 辅助色 \*/
\--color-secondary-light: #666;
\--color-secondary-dark: #222;\--color-background: #ffffff; /\* 主要背景色 \*/
\--color-background-alt: #f9fafb; /\* 交替背景色 \*/
\--color-background-hover: #f3f4f6; /\* 悬停背景色 \*/
\--color-background-active: #e5e7eb; /\* 激活背景色 \*/
\--color-background-card: #ffffff; /\* 卡片背景色 \*/
\--color-background-modal: #ffffff; /\* 模态框背景色 \*/
\--color-background-overlay: rgba(0, 0, 0, 0.5); /\* 遮罩层背景色 \*/\--color-text: #000000; /\* 主要文本色 \*/
\--color-text-light: #374151; /\* 浅色文本 \*/
\--color-text-lighter: #6B7280; /\* 更浅文本 \*/
\--color-text-muted: #3d3d3d; /\* 次要文本 \*/
\--color-text-disabled: #9CA3AF; /\* 禁用文本色 \*/
\--color-text-inverse: #ffffff; /\* 深色背景上的文本 \*/\--color-success: #52c41a; /\* 成功色 \*/
\--color-warning: #fa8c16; /\* 警告色 \*/
\--color-danger: #ff4d4f; /\* 危险/错误色 \*/
\--color-info: #4096ff; /\* 信息色 \*/提供从--color-neutral-50(最浅)到--color-neutral-950(最深)的完整中性色阶,满足各种场景需求。
包含红、橙、黄、绿、青、蓝、紫七个色系,每个色系都有从 50 到 950 的色阶变化,如:
/\* 红色系示例 \*/
\--color-red-50: #fff5f5;
\--color-red-100: #ffe3e3;
/\* ... 中间色阶省略 ... \*/
\--color-red-950: #5c0d12;\--font-family-main: 'Helvetica Neue', Helvetica, 'PingFang SC', ...; /\* 主要字体 \*/
\--font-family-mono: 'SF Mono', Menlo, Monaco, ...; /\* 等宽字体(代码用) \*/
\--font-family-display: var(--font-family-main); /\* 标题字体 \*/
/\* 字体大小 \*/
\--font-size-xs: 10px;
\--font-size-sm: 12px;
\--font-size-md: 13px;
\--font-size-lg: 14px;
\--font-size-xl: 16px;
\--font-size-2xl: 18px;
\--font-size-3xl: 22px;
\--font-size-4xl: 26px;
\--font-size-5xl: 32px;
\--font-size-6xl: 40px;
/\* 字体权重 \*/
\--font-weight-light: 300;
\--font-weight-normal: 400;
\--font-weight-medium: 500;
\--font-weight-semibold: 600;
\--font-weight-bold: 700;
\--font-weight-extrabold: 800;
/\* 行高 \*/
\--line-height-xs: 1.2;
\--line-height-sm: 1.3;
\--line-height-md: 1.5;
\--line-height-lg: 1.6;
\--line-height-xl: 1.8;/\* 边框宽度 \*/
\--border-width: 1px;
\--border-width-sm: 0.5px; /\* 细边框 \*/
\--border-width-lg: 2px; /\* 粗边框 \*/
/\* 边框圆角 \*/
\--border-radius: 4px;
\--border-radius-sm: 2px; /\* 小圆角 \*/
\--border-radius-lg: 6px; /\* 大圆角化 \*/
\--border-radius-xl: 8px;
\--border-radius-full: 9999px; /\* 全圆角(圆形) \*/
/\* 边框颜色 \*/
\--color-border: #ccc;
\--color-border-light: #e5e7eb; /\* 浅色边框 \*/
\--color-border-dark: #9CA3AF; /\* 深色边框 \*/
\--color-border-primary: var(--color-primary); /\* 主色边框 \*/\--spacing-0: 0; /\* 零间距 \*/
\--spacing-xxs: 2px; /\* 极小间距 \*/
\--spacing-xs: 4px;
\--spacing-sm: 5px;
\--spacing-md: 10px;
\--spacing-lg: 20px;
\--spacing-xl: 25px;
\--spacing-2xl: 32px; /\* 更大间距 \*/
\--spacing-3xl: 40px;
\--spacing-4xl: 56px;
\--spacing-5xl: 72px;\<!DOCTYPE html>
\<html lang="zh-CN">
\<head>
  \<meta charset="UTF-8">
  \<meta name="viewport" content="width=device-width, initial-scale=1.0">
  \<title>框架示例\</title>
  \<link rel="stylesheet" href="path/to/enhanced-css-framework.css">
\</head>
\<body class="bg-background">
  \<div class="container">
  \<div class="row">
  \<div class="col-md-6">
  \<!-- 内容 -->
  \</div>
  \<div class="col-md-6">
  \<!-- 内容 -->
  \</div>
  \</div>
  \</div>
\</body>
\</html>0\<!DOCTYPE html>
\<html lang="zh-CN">
\<head>
  \<meta charset="UTF-8">
  \<meta name="viewport" content="width=device-width, initial-scale=1.0">
  \<title>框架示例\</title>
  \<link rel="stylesheet" href="path/to/enhanced-css-framework.css">
\</head>
\<body class="bg-background">
  \<div class="container">
  \<div class="row">
  \<div class="col-md-6">
  \<!-- 内容 -->
  \</div>
  \<div class="col-md-6">
  \<!-- 内容 -->
  \</div>
  \</div>
  \</div>
\</body>
\</html>1框架采用 12 列网格布局,通过容器(container)、行(row)和列(col)的组合实现灵活的页面布局。
容器用于包裹网格内容,提供居中对齐和内边距控制。
| 类名 | 说明 | 最大宽度 |
|---|---|---|
.container | 基础容器 | 1200px |
.container-sm | 小型容器 | 540px |
.container-md | 中型容器 | 720px |
.container-lg | 大型容器 | 960px |
.container-xl | 特大型容器 | 1140px |
.container-xxl | 超大型容器 | 1320px |
.container-fluid | 流体容器 | 100% 宽度 |
使用示例:
\<!DOCTYPE html>
\<html lang="zh-CN">
\<head>
  \<meta charset="UTF-8">
  \<meta name="viewport" content="width=device-width, initial-scale=1.0">
  \<title>框架示例\</title>
  \<link rel="stylesheet" href="path/to/enhanced-css-framework.css">
\</head>
\<body class="bg-background">
  \<div class="container">
  \<div class="row">
  \<div class="col-md-6">
  \<!-- 内容 -->
  \</div>
  \<div class="col-md-6">
  \<!-- 内容 -->
  \</div>
  \</div>
  \</div>
\</body>
\</html>2行(Row)用于包裹列(Column),并提供负外边距抵消列的内边距,确保布局对齐。
| 类名 | 说明 |
|---|---|
.row | 基础行 |
.row-gutter-sm | 小间距行(8px) |
.row-gutter-lg | 大间距行(24px) |
使用示例:
\<!DOCTYPE html>
\<html lang="zh-CN">
\<head>
  \<meta charset="UTF-8">
  \<meta name="viewport" content="width=device-width, initial-scale=1.0">
  \<title>框架示例\</title>
  \<link rel="stylesheet" href="path/to/enhanced-css-framework.css">
\</head>
\<body class="bg-background">
  \<div class="container">
  \<div class="row">
  \<div class="col-md-6">
  \<!-- 内容 -->
  \</div>
  \<div class="col-md-6">
  \<!-- 内容 -->
  \</div>
  \</div>
  \</div>
\</body>
\</html>3列是网格系统的核心,通过指定占比来控制宽度。框架采用 12 列系统,每列的宽度为100% / 12 * 列数。
基础列类:
| 类名 | 说明 | 宽度占比 |
|---|---|---|
.col-1 | 1 列宽 | 8.333% |
.col-2 | 2 列宽 | 16.666% |
| ... | ... | ... |
.col-12 | 12 列宽 | 100% |
.col | 自动分配宽度 | 平均分配 |
.col-auto | 自动宽度 | 由内容决定 |
使用示例:
\<!DOCTYPE html>
\<html lang="zh-CN">
\<head>
  \<meta charset="UTF-8">
  \<meta name="viewport" content="width=device-width, initial-scale=1.0">
  \<title>框架示例\</title>
  \<link rel="stylesheet" href="path/to/enhanced-css-framework.css">
\</head>
\<body class="bg-background">
  \<div class="container">
  \<div class="row">
  \<div class="col-md-6">
  \<!-- 内容 -->
  \</div>
  \<div class="col-md-6">
  \<!-- 内容 -->
  \</div>
  \</div>
  \</div>
\</body>
\</html>4框架提供 6 个响应式断点,支持在不同屏幕尺寸下调整布局:
| 断点前缀 | 断点值 | 说明 |
|---|---|---|
xs | 0 | 超小屏幕(手机,默认) |
sm | 576px | 小屏幕(平板竖屏) |
md | 768px | 中等屏幕(平板横屏) |
lg | 992px | 大屏幕(笔记本 / 小桌面) |
xl | 1200px | 特大屏幕(桌面) |
xxl | 1400px | 超特大屏幕(大桌面) |
响应式列类命名规则:.col-[断点前缀]-[列数]
使用示例:
\<!DOCTYPE html>
\<html lang="zh-CN">
\<head>
  \<meta charset="UTF-8">
  \<meta name="viewport" content="width=device-width, initial-scale=1.0">
  \<title>框架示例\</title>
  \<link rel="stylesheet" href="path/to/enhanced-css-framework.css">
\</head>
\<body class="bg-background">
  \<div class="container">
  \<div class="row">
  \<div class="col-md-6">
  \<!-- 内容 -->
  \</div>
  \<div class="col-md-6">
  \<!-- 内容 -->
  \</div>
  \</div>
  \</div>
\</body>
\</html>5通过偏移类可以控制列的左侧留白,实现列的右移效果。
偏移类命名规则:.offset-[断点前缀]-[偏移列数]
使用示例:
\<!DOCTYPE html>
\<html lang="zh-CN">
\<head>
  \<meta charset="UTF-8">
  \<meta name="viewport" content="width=device-width, initial-scale=1.0">
  \<title>框架示例\</title>
  \<link rel="stylesheet" href="path/to/enhanced-css-framework.css">
\</head>
\<body class="bg-background">
  \<div class="container">
  \<div class="row">
  \<div class="col-md-6">
  \<!-- 内容 -->
  \</div>
  \<div class="col-md-6">
  \<!-- 内容 -->
  \</div>
  \</div>
  \</div>
\</body>
\</html>6通过排序类可以改变列的显示顺序,而不改变 HTML 结构。
排序类:
| 类名 | 说明 |
|---|---|
.order-first | 排在最前面 |
.order-last | 排在最后面 |
.order-[n] | 排在第 n 位(n 为 0-12) |
.order-[断点前缀]-first | 在指定断点排在最前面 |
.order-[断点前缀]-last | 在指定断点排在最后面 |
.order-[断点前缀]-[n] | 在指定断点排在第 n 位 |
使用示例:
\<!DOCTYPE html>
\<html lang="zh-CN">
\<head>
  \<meta charset="UTF-8">
  \<meta name="viewport" content="width=device-width, initial-scale=1.0">
  \<title>框架示例\</title>
  \<link rel="stylesheet" href="path/to/enhanced-css-framework.css">
\</head>
\<body class="bg-background">
  \<div class="container">
  \<div class="row">
  \<div class="col-md-6">
  \<!-- 内容 -->
  \</div>
  \<div class="col-md-6">
  \<!-- 内容 -->
  \</div>
  \</div>
  \</div>
\</body>
\</html>7框架提供了丰富的工具类,用于快速设置元素样式,避免重复编写 CSS。
| 类名 | 说明 |
|---|---|
.hidden | 隐藏元素(display: none) |
.invisible | 不可见但保留空间(visibility: hidden) |
.visible | 可见(visibility: visible) |
.sr-only | 仅屏幕阅读器可见 |
.d-none | 不显示 |
.d-block | 块级显示 |
.d-flex | Flex 布局显示 |
.d-sm-none | 在 sm 断点及以上不显示 |
.d-sm-block | 在 sm 断点及以上块级显示 |
.d-sm-flex | 在 sm 断点及以上 Flex 显示 |
| ... | 类似的 md/lg/xl/xxl 前缀类 |
使用示例:
\<!DOCTYPE html>
\<html lang="zh-CN">
\<head>
  \<meta charset="UTF-8">
  \<meta name="viewport" content="width=device-width, initial-scale=1.0">
  \<title>框架示例\</title>
  \<link rel="stylesheet" href="path/to/enhanced-css-framework.css">
\</head>
\<body class="bg-background">
  \<div class="container">
  \<div class="row">
  \<div class="col-md-6">
  \<!-- 内容 -->
  \</div>
  \<div class="col-md-6">
  \<!-- 内容 -->
  \</div>
  \</div>
  \</div>
\</body>
\</html>8| 类名 | 说明 |
|---|---|
.flex | 启用 Flex 布局 |
.inline-flex | 启用内联 Flex 布局 |
.flex-row | 水平方向排列(默认) |
.flex-row-reverse | 水平反向排列 |
.flex-col | 垂直方向排列 |
.flex-col-reverse | 垂直反向排列 |
.flex-wrap | 允许换行 |
.flex-nowrap | 不允许换行 |
.justify-start | 主轴起点对齐 |
.justify-end | 主轴终点对齐 |
.justify-center | 主轴居中对齐 |
.justify-between | 主轴两端对齐 |
.justify-around | 主轴均匀分布 |
.items-start | 交叉轴起点对齐 |
.items-end | 交叉轴终点对齐 |
.items-center | 交叉轴居中对齐 |
.items-baseline | 交叉轴基线对齐 |
.items-stretch | 交叉轴拉伸对齐 |
.flex-1 | Flex 项目占满剩余空间 |
.flex-auto | Flex 项目自动调整 |
.flex-none | Flex 项目不伸缩 |
使用示例:
\<!DOCTYPE html>
\<html lang="zh-CN">
\<head>
  \<meta charset="UTF-8">
  \<meta name="viewport" content="width=device-width, initial-scale=1.0">
  \<title>框架示例\</title>
  \<link rel="stylesheet" href="path/to/enhanced-css-framework.css">
\</head>
\<body class="bg-background">
  \<div class="container">
  \<div class="row">
  \<div class="col-md-6">
  \<!-- 内容 -->
  \</div>
  \<div class="col-md-6">
  \<!-- 内容 -->
  \</div>
  \</div>
  \</div>
\</body>
\</html>9| 类名 | 说明 |
|---|---|
.grid | 启用 Grid 布局 |
.grid-cols-2 | 2 列网格 |
.grid-cols-3 | 3 列网格 |
.grid-cols-4 | 4 列网格 |
.grid-cols-auto | 自动列数 |
.gap-0 至 .gap-2xl | 网格间距 |
使用示例:
\--color-primary: #007BFF; /\* 主色调 \*/
\--color-primary-light: #3395FF; /\* 主色浅变体 \*/
\--color-primary-dark: #0056D2; /\* 主色深变体 \*/
\--color-primary-transparent: rgba(0, 123, 255, 0.15); /\* 主色透明变体 \*/
\--color-primary-rgb: 0, 123, 255; /\* 主色RGB值(用于rgba计算) \*/
\--color-secondary: #444; /\* 辅助色 \*/
\--color-secondary-light: #666;
\--color-secondary-dark: #222;0| 类名 | 说明 |
|---|---|
.position-static | 静态定位 |
.position-relative | 相对定位 |
.position-absolute | 绝对定位 |
.position-fixed | 固定定位 |
.position-sticky | 粘性定位 |
.top-0 | 顶部对齐 |
.right-0 | 右侧对齐 |
.bottom-0 | 底部对齐 |
.left-0 | 左侧对齐 |
间距工具类用于快速设置元素的外边距(margin)和内边距(padding),命名规则如下:
m-(margin)或 p-(padding)t(上)、b(下)、l(左)、r(右)、x(左右)、y(上下)0、xxs、xs、sm、md、lg、xl、2xl常用间距类:
| 类名 | 说明 |
|---|---|
.m-0 | 全方向外边距为 0 |
.p-md | 全方向内边距为 md(10px) |
.mt-sm | 上外边距为 sm(5px) |
.mb-lg | 下外边距为 lg(20px) |
.px-xl | 左右内边距为 xl(25px) |
.py-2xl | 上下内边距为 2xl(32px) |
使用示例:
\--color-primary: #007BFF; /\* 主色调 \*/
\--color-primary-light: #3395FF; /\* 主色浅变体 \*/
\--color-primary-dark: #0056D2; /\* 主色深变体 \*/
\--color-primary-transparent: rgba(0, 123, 255, 0.15); /\* 主色透明变体 \*/
\--color-primary-rgb: 0, 123, 255; /\* 主色RGB值(用于rgba计算) \*/
\--color-secondary: #444; /\* 辅助色 \*/
\--color-secondary-light: #666;
\--color-secondary-dark: #222;1| 类名 | 说明 |
|---|---|
.border | 基础边框 |
.border-0 | 无边框 |
.border-sm | 细边框 |
.border-lg | 粗边框 |
.border-dashed | 虚线边框 |
.border-primary | 主色边框 |
.border-success | 成功色边框 |
.border-warning | 警告色边框 |
.border-danger | 危险色边框 |
.border-t | 上边框 |
.border-r | 右边框 |
.border-b | 下边框 |
.border-l | 左边框 |
.border-t-0 | 无上边框 |
| ... | 类似的 r-0/b-0/l-0 |
圆角工具:
| 类名 | 说明 |
|---|---|
.rounded | 基础圆角 |
.rounded-0 | 无圆角 |
.rounded-sm | 小圆角 |
.rounded-lg | 大圆角化 |
.rounded-xl | 超大圆角 |
.rounded-full | 全圆角(圆形) |
.rounded-t | 上圆角 |
.rounded-r | 右圆角 |
.rounded-b | 下圆角 |
.rounded-l | 左圆角 |
使用示例:
\--color-primary: #007BFF; /\* 主色调 \*/
\--color-primary-light: #3395FF; /\* 主色浅变体 \*/
\--color-primary-dark: #0056D2; /\* 主色深变体 \*/
\--color-primary-transparent: rgba(0, 123, 255, 0.15); /\* 主色透明变体 \*/
\--color-primary-rgb: 0, 123, 255; /\* 主色RGB值(用于rgba计算) \*/
\--color-secondary: #444; /\* 辅助色 \*/
\--color-secondary-light: #666;
\--color-secondary-dark: #222;2| 类名 | 说明 |
|---|---|
.text-left | 左对齐 |
.text-center | 居中对齐 |
.text-right | 右对齐 |
.text-justify | 两端对齐 |
| 类名 | 说明 |
|---|---|
.text-primary | 主色文本 |
.text-secondary | 辅助色文本 |
.text-text | 主要文本色 |
.text-text-light | 浅色文本 |
.text-muted | 次要文本 |
.text-disabled | 禁用文本色 |
.text-inverse | 反色文本(用于深色背景) |
.text-success | 成功色文本 |
.text-warning | 警告色文本 |
.text-danger | 危险色文本 |
.text-info | 信息色文本 |
| 类名 | 说明 | 对应变量 |
|---|---|---|
.text-xs | 超小文本 | --font-size-xs (10px) |
.text-sm | 小文本 | --font-size-sm (12px) |
.text-md | 中等文本 | --font-size-md (13px) |
.text-lg | 大文本 | --font-size-lg (14px) |
.text-xl | 超大文本 | --font-size-xl (16px) |
.text-2xl 至 .text-5xl | 更大文本 | 对应变量逐步增大 |
| 类名 | 说明 | 对应变量 |
|---|---|---|
.font-light | 轻量 | --font-weight-light (300) |
.font-normal | 正常 | --font-weight-normal (400) |
.font-medium | 中等 | --font-weight-medium (500) |
.font-semibold | 半粗体 | --font-weight-semibold (600) |
.font-bold | 粗体 | --font-weight-bold (700) |
.font-extrabold | 特粗体 | --font-weight-extrabold (800) |
| 类名 | 说明 |
|---|---|
.text-underline | 下划线 |
.text-underline-hover | hover 时显示下划线 |
.text-no-underline | 无下划线 |
.text-uppercase | 大写 |
.text-lowercase | 小写 |
.text-capitalize | 首字母大写 |
使用示例:
\--color-primary: #007BFF; /\* 主色调 \*/
\--color-primary-light: #3395FF; /\* 主色浅变体 \*/
\--color-primary-dark: #0056D2; /\* 主色深变体 \*/
\--color-primary-transparent: rgba(0, 123, 255, 0.15); /\* 主色透明变体 \*/
\--color-primary-rgb: 0, 123, 255; /\* 主色RGB值(用于rgba计算) \*/
\--color-secondary: #444; /\* 辅助色 \*/
\--color-secondary-light: #666;
\--color-secondary-dark: #222;3背景工具类用于快速设置元素的背景色,命名规则为.bg-[颜色名称]。
常用背景类:
| 类名 | 说明 |
|---|---|
.bg-primary | 主色背景 |
.bg-primary-light | 主色浅色背景 |
.bg-background | 主要背景色 |
.bg-background-alt | 交替背景色 |
.bg-background-hover | 悬停背景色 |
.bg-success | 成功色背景 |
.bg-success-bg | 成功色浅色背景 |
.bg-warning | 警告色背景 |
.bg-warning-bg | 警告色浅色背景 |
.bg-danger | 危险色背景 |
.bg-danger-bg | 危险色浅色背景 |
.bg-neutral-[n] | 中性色背景(n 为 50-900) |
使用示例:
\--color-primary: #007BFF; /\* 主色调 \*/
\--color-primary-light: #3395FF; /\* 主色浅变体 \*/
\--color-primary-dark: #0056D2; /\* 主色深变体 \*/
\--color-primary-transparent: rgba(0, 123, 255, 0.15); /\* 主色透明变体 \*/
\--color-primary-rgb: 0, 123, 255; /\* 主色RGB值(用于rgba计算) \*/
\--color-secondary: #444; /\* 辅助色 \*/
\--color-secondary-light: #666;
\--color-secondary-dark: #222;4| 类名 | 说明 |
|---|---|
.transition | 基础过渡效果 |
.transition-none | 无过渡 |
.transition-fast | 快速过渡(150ms) |
.transition-normal | 正常过渡(300ms) |
.transition-slow | 慢速过渡(500ms) |
.transition-color | 仅颜色过渡 |
.transition-bg | 仅背景色过渡 |
.transition-border | 仅边框过渡 |
.transition-transform | 仅变换过渡 |
.transition-shadow | 仅阴影过渡 |
| 类名 | 说明 |
|---|---|
.animate-fade-in | 淡入动画 |
.animate-fade-out | 淡出动画 |
.animate-slide-up | 上滑动画 |
.animate-slide-down | 下滑动画 |
.animate-slide-left | 左滑动画 |
.animate-slide-right | 右滑动画 |
.animate-bounce | 弹跳动画 |
.animate-pulse | 脉冲动画 |
.animate-shake | 抖动动画 |
.animate-spin | 旋转动画 |
.animate-zoom-in | 放大动画 |
.animate-zoom-out | 缩小动画 |
使用示例:
\--color-primary: #007BFF; /\* 主色调 \*/
\--color-primary-light: #3395FF; /\* 主色浅变体 \*/
\--color-primary-dark: #0056D2; /\* 主色深变体 \*/
\--color-primary-transparent: rgba(0, 123, 255, 0.15); /\* 主色透明变体 \*/
\--color-primary-rgb: 0, 123, 255; /\* 主色RGB值(用于rgba计算) \*/
\--color-secondary: #444; /\* 辅助色 \*/
\--color-secondary-light: #666;
\--color-secondary-dark: #222;5| 类名 | 说明 |
|---|---|
.shadow | 基础阴影 |
.shadow-sm | 小阴影 |
.shadow-lg | 大阴影 |
.shadow-xl | 超大阴影 |
.shadow-primary | 主色阴影 |
.shadow-hover | hover 时显示更大阴影 |
.w-100 | 宽度 100% |
.h-100 | 高度 100% |
.w-auto | 宽度自动 |
.h-auto | 高度自动 |
.max-w-100 | 最大宽度 100% |
.overflow-hidden | 溢出隐藏 |
.overflow-auto | 溢出自动滚动 |
.cursor-pointer | 鼠标指针为手型 |
.cursor-not-allowed | 鼠标指针为禁止 |
.opacity-0 | 透明度 0 |
.opacity-50 | 透明度 50% |
.opacity-100 | 透明度 100% |
.zoom-hover | hover 时轻微放大 |
使用示例:
\--color-primary: #007BFF; /\* 主色调 \*/
\--color-primary-light: #3395FF; /\* 主色浅变体 \*/
\--color-primary-dark: #0056D2; /\* 主色深变体 \*/
\--color-primary-transparent: rgba(0, 123, 255, 0.15); /\* 主色透明变体 \*/
\--color-primary-rgb: 0, 123, 255; /\* 主色RGB值(用于rgba计算) \*/
\--color-secondary: #444; /\* 辅助色 \*/
\--color-secondary-light: #666;
\--color-secondary-dark: #222;6\--color-primary: #007BFF; /\* 主色调 \*/
\--color-primary-light: #3395FF; /\* 主色浅变体 \*/
\--color-primary-dark: #0056D2; /\* 主色深变体 \*/
\--color-primary-transparent: rgba(0, 123, 255, 0.15); /\* 主色透明变体 \*/
\--color-primary-rgb: 0, 123, 255; /\* 主色RGB值(用于rgba计算) \*/
\--color-secondary: #444; /\* 辅助色 \*/
\--color-secondary-light: #666;
\--color-secondary-dark: #222;7\--color-primary: #007BFF; /\* 主色调 \*/
\--color-primary-light: #3395FF; /\* 主色浅变体 \*/
\--color-primary-dark: #0056D2; /\* 主色深变体 \*/
\--color-primary-transparent: rgba(0, 123, 255, 0.15); /\* 主色透明变体 \*/
\--color-primary-rgb: 0, 123, 255; /\* 主色RGB值(用于rgba计算) \*/
\--color-secondary: #444; /\* 辅助色 \*/
\--color-secondary-light: #666;
\--color-secondary-dark: #222;8\--color-primary: #007BFF; /\* 主色调 \*/
\--color-primary-light: #3395FF; /\* 主色浅变体 \*/
\--color-primary-dark: #0056D2; /\* 主色深变体 \*/
\--color-primary-transparent: rgba(0, 123, 255, 0.15); /\* 主色透明变体 \*/
\--color-primary-rgb: 0, 123, 255; /\* 主色RGB值(用于rgba计算) \*/
\--color-secondary: #444; /\* 辅助色 \*/
\--color-secondary-light: #666;
\--color-secondary-dark: #222;9\--color-background: #ffffff; /\* 主要背景色 \*/
\--color-background-alt: #f9fafb; /\* 交替背景色 \*/
\--color-background-hover: #f3f4f6; /\* 悬停背景色 \*/
\--color-background-active: #e5e7eb; /\* 激活背景色 \*/
\--color-background-card: #ffffff; /\* 卡片背景色 \*/
\--color-background-modal: #ffffff; /\* 模态框背景色 \*/
\--color-background-overlay: rgba(0, 0, 0, 0.5); /\* 遮罩层背景色 \*/0\--color-background: #ffffff; /\* 主要背景色 \*/
\--color-background-alt: #f9fafb; /\* 交替背景色 \*/
\--color-background-hover: #f3f4f6; /\* 悬停背景色 \*/
\--color-background-active: #e5e7eb; /\* 激活背景色 \*/
\--color-background-card: #ffffff; /\* 卡片背景色 \*/
\--color-background-modal: #ffffff; /\* 模态框背景色 \*/
\--color-background-overlay: rgba(0, 0, 0, 0.5); /\* 遮罩层背景色 \*/1以上就是增强版 CSS 框架的详细使用文档。通过灵活运用框架提供的网格系统和工具类,可以快速构建出美观、一致且响应式的网页界面。如需进一步定制,可以通过修改全局变量来调整主题样式,无需修改工具类代码。
(注:文档部分内容可能由 AI 生成)]]>

















]]>陈默的拖鞋在地板上打滑,慌乱中把待产包抱成了一团。急诊室的灯亮起来时,林晚额角的汗已经打湿了碎发。宫缩的疼痛像潮水反复涌来,她咬着唇数墙上的时钟,陈默的声音始终贴在耳边:“我们说好要一起等宝宝踢第一脚的。”
凌晨两点,产房的门终于打开。护士抱着裹在粉毯里的小家伙出来时,陈默的领带还歪在肩上。“3200 克,女孩。” 护士的话音刚落,他突然蹲在走廊里哭了 —— 刚才林晚被推进产房前,还攥着他的手笑:“别担心,我看过育儿书。”
林晚醒来时,晨光正落在婴儿床的纱帐上。小家伙闭着眼睛,小拳头攥得紧紧的,嘴角还带着奶渍。陈默坐在床边,笨拙地学着护士的样子给宝宝换尿布,尿布却歪歪扭扭裹成了一团。“她刚才抓我的手指了。” 他抬头时,眼底还闪着光,“跟你一样,手指尖都是圆圆的。”
窗外的梧桐叶沙沙作响,林晚轻轻碰了碰女儿的脸颊。那一刻,所有的疼痛都化作了掌心的温度 —— 原来生命最神奇的礼物,就是让两个普通人,突然有了软肋,也有了铠甲。
]]>