X.com 界面精简与优化
x.com 界面精简与优化 by HahaCodeLife
Details
AuthorHahaCodeLife
LicenseNo License
Categoryx.com
Created
Updated
Size2.2 kB
Statistics
Learn how we calculate statistics in the FAQ.
Failed to fetch stats.
Description
Notes
Userstyle doesn't have notes.Source code
/* ==UserStyle==
@name x.com - 2024年7月
@namespace github.com/openstyles/stylus
@version 1.0.0
@description A new userstyle
@author Me
==/UserStyle== */
@-moz-document url-prefix("https://x.com/home") {
/* 在此插入代码... */
/* 让左侧导航栏直接靠左对齐 */
header[role="banner"] {
position: fixed !important;
left: 0 !important;
top: 0 !important;
bottom: 0 !important;
width: auto !important;
padding-right: 12px !important;
}
/* 调整左侧导航栏内部元素 */
header[role="banner"] > div > div {
padding-left: 12px !important;
}
/* 让主内容区域占据剩余空间 */
main[role="main"] {
margin-left: 347px !important;
width: calc(100% - 88px) !important;
max-width: none !important;
}
/* 调整主内容区域 */
[data-testid="primaryColumn"] {
width: 100% !important;
max-width: none !important;
}
/* 增加主内容区域的宽度 */
.r-1ye8kvj {
max-width: none !important;
width: 100% !important;
}
/* 调整推文文本的字体大小和行高 */
[data-testid="tweetText"] span {
font-size: 28px !important;
line-height: 32px !important;
}
/* 确保所有推文文本至少有28px的字号 */
.css-901oao {
font-size: 28px !important;
line-height: 32px !important;
}
/* 调整标题大小 */
h1 {
font-size: 32px;
}
h2 {
font-size: 30px;
}
h3 {
font-size: 28px;
}
/* 调整其他文本元素的大小 */
.css-1dbjc4n .css-901oao {
font-size: 24px;
}
.css-1dbjc4n .css-901oao.css-16my406 {
font-size: 22px;
}
/* 确保内容不会太宽,保持良好的阅读体验 */
.r-1ye8kvj > div {
min-width: 62vw !important;
/* max-width: 1000px !important;
margin: 0 auto !important; */
}
/* 隐藏右侧栏 */
[data-testid="sidebarColumn"] {
display: none !important;
}
div.css-146c3p1.r-8akbws.r-krxsd3.r-dnmrzs.r-1udh08x.r-bcqeeo.r-1ttztb7.r-qvutc0.r-37j5jr.r-a023e6.r-rjixqe.r-16dba41.r-bnwqim {
font-size: 32px;
line-height: 38px;
}
/* 左侧导航区域样式设置 */
span.css-1jxf684.r-bcqeeo.r-1ttztb7.r-qvutc0.r-poiln3 {
font-size: 32px;
line-height: 38px;
}
}