- 注册
- 10 16, 2023
- 消息
- 1,756
- G
- 10,050 G
- 主题 作者
- #1
登录XenForo后台--风格&语言-模板列表中搜索 extra.less 这个模板,并在此模板中加入下列代码:
效果如下图:
代码:
/*** 资源中心列表样式 ***/
@resource-grid-gap: 10px;
@resource-grid-width: 330px;
@resource-grid-thumb: 90px; // 调整图标的大小,减少高度
@media (min-width: @xf-responsiveMedium){
@supports(display: grid){
.block[data-type="resource"] .structItemContainer{
display: grid;
grid-template-columns: repeat(auto-fit, minmax(@resource-grid-width, 1fr));
grid-gap: @resource-grid-gap;
padding: @resource-grid-gap;
background-color: @xf-contentAltBg;
}
.structItem--resource {
background-color: @xf-contentBg;
border-radius: 3px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
border-width: 0px;
display: grid;
grid-template-columns: @resource-grid-thumb 1fr;
grid-template-areas: 'icon text' 'stats stats';
padding: 8px; // 减少整体内边距
.structItem-cell--icon.structItem-cell--iconExpanded{
width: auto;
grid-area: icon;
}
.structItem-cell--main {
grid-area: text;
padding: 4px 10px; // 减少文本区域的内边距
}
.structItem-cell--resourceMeta {
grid-area: stats;
width: auto;
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
padding: 4px 10px; // 减少元数据区域的内边距
}
.structItem-cell--iconExpanded .structItem-iconContainer .avatar {
width: 100%;
height: auto;
font-size: 48px; // 调整图标的大小
}
.structItem-secondaryIcon {
display: none;
}
.structItem-metaItem--rating{
flex: 1 0 100%;
}
.structItem-metaItem--downloads,
.structItem-metaItem--lastUpdate{
flex: 0 1 auto;
}
.ratingStarsRow--justified {
border-bottom: 1px solid @xf-borderColorFaint;
margin-bottom: 2px; // 减少下边距
padding-bottom: 2px; // 减少内边距
}
}
}
}