hulai-website/assets/less/mixins.less
刘涛 a25f3a77ce sync: 同步最新呼籁官网代码到仓库
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 21:57:35 +08:00

77 行
1.4 KiB
Plaintext

此文件含有模棱两可的 Unicode 字符

此文件含有可能会与其他字符混淆的 Unicode 字符。 如果您是想特意这样的,可以安全地忽略该警告。 使用 Escape 按钮显示他们。

// ============================================
// 呼籁旅行官网 - Less混入
// ============================================
// 响应式断点
.respond-md(@rules) {
@media (min-width: @breakpoint-md) {
@rules();
}
}
.respond-lg(@rules) {
@media (min-width: @breakpoint-lg) {
@rules();
}
}
.respond-xl(@rules) {
@media (min-width: @breakpoint-xl) {
@rules();
}
}
// 容器
.container() {
width: 100%;
max-width: @container-max-width;
margin-left: auto;
margin-right: auto;
padding-left: @container-padding;
padding-right: @container-padding;
.respond-lg({
padding-left: @container-padding-desktop;
padding-right: @container-padding-desktop;
});
}
// 段落间距 — 更大的呼吸感
.section-padding() {
padding-top: @space-2xl;
padding-bottom: @space-2xl;
.respond-md({
padding-top: @space-3xl;
padding-bottom: @space-3xl;
});
.respond-lg({
padding-top: 100px;
padding-bottom: 100px;
});
}
// 响应式网格移动1列 → 平板2列 → 桌面3列
.grid-responsive(@gap: @space-lg; @md-cols: 2; @lg-cols: 3) {
display: grid;
grid-template-columns: 1fr;
gap: @gap;
.respond-md({
grid-template-columns: repeat(@md-cols, 1fr);
});
.respond-lg({
grid-template-columns: repeat(@lg-cols, 1fr);
});
}
// 多行截断
.text-clamp(@lines: 3) {
display: -webkit-box;
-webkit-line-clamp: @lines;
-webkit-box-orient: vertical;
overflow: hidden;
}