此页为于 SCP 维基内部使用的“组件”页。用于在其他页面中引用。
这是什么
我
Croquembouche用在一大堆页面上的一大堆各种各样的CSS“改进”,因为我觉得这样就能使其更容易处理。
该组件做出了很多非常细碎的改动以使得写作体验更加舒服且能够使制作组件/版式更加容易一点(也就是我经常干的事)。它不会对读者来说在视觉上改变页面中的任何东西——这些改动是为作者服务的。
我不期望用了这个组件的文章的翻译版也会用到这个组件,除非那个翻译者也喜欢这个组件而且也想用这个组件之类的。
这个组件可能不会与其它组件或版式冲突,且即使会冲突,也可能不会有什么影响。
用法
在任意维基上:
[[include :scp-wiki:component:croqstyle]]
该组件被设计于与其它组件一同使用,所以-=-是用来隐藏该文档的。在另一个组件内使用时,请确保将该组件放在[[iftags]]块内,这样你的组件的用户就不会强制同样使用 Croq 风格。
相关组件
其它个人自定义组件(只会改变一点点东西):
个人自定义版式(在视觉上有大的变化):
CSS修改
大小合理的脚注
不让脚注达到一百万里那么宽,让你能确实地阅读脚注。
.hovertip { max-width: 400px; }
等宽字体编辑/代码
使编辑文本框内字体等宽,且将所有等宽字文本改为Fira Code,也是个明显很优秀的等宽字字体。
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;700&display=swap');
:root { --mono-font: "Fira Code", Cousine, monospace; }
#edit-page-textarea, .code pre, .code p, .code, tt, .page-source { font-family: var(--mono-font); }
.code pre * { white-space: pre; }
.code *, .pre * { font-feature-settings: unset; }
电传打字机背景
给<tt>元素加上亮灰色的背景({{文本}}),使得代码片段更为突出。
tt {
background-color: var(--swatch-something-bhl-idk-will-fix-later, #f4f4f4);
font-size: 85%;
padding: 0.2em 0.4em;
margin: 0;
border-radius: 6px;
}
不要大脸
禁用悬停于某人的头像的时候出现的大图片,因为这图片又蠢又真的很烦人,想看大头像版本的话直接点击一下就行了。
.avatar-hover { display: none !important; }
碎裂碎裂
任何在带有nobreak类的div中的文本可以在字母间自动换行。
.nobreak { word-break: break-all; }
代码颜色
将我终端中的代码颜色加为变量。可能我会在什么时候把它改成比如Monokai或者别的更加常见的终端主题,但是现在暂时这还是我的个人主题,是从Tomorrow Night Eighties中衍生而来的。
还有,将.terminal类像[[div class="code terminal"]]一样添加到假代码方块中可以让它有一个有点伪终端样的暗色背景。不能用在[[code]]中,因为Wikidot嵌入了一大堆语法来使其高亮,不用一大堆CSS是改不动的。只能用在非[[code]]的代码片段中。
:root {
--c-bg: #393939;
--c-syntax: #e0e0e0;
--c-comment: #999999;
--c-error: #f2777a;
--c-value: #f99157;
--c-symbol: #ffcc66;
--c-string: #99cc99;
--c-operator: #66cccc;
--c-builtin: #70a7df;
--c-keyword: #cc99cc;
}
.terminal, .terminal > .code {
color: var(--c-syntax);
background: var(--c-bg);
border: 0.4rem solid var(--c-comment);
border-radius: 1rem;
}
调试模式
将位于.debug-mode中的任何东西周围画上线。线的颜色是红色的但是遵从CSS变量--debug-colour。
你还可以将div.debug-info.over与div.debug-info.under添加到某个元素中以给调试框加注释——虽然你得确保有留下足够的垂直空间,让注释不会与其上方或下方的东西重叠。
.debug-mode, .debug-mode *, .debug-mode *::before, .debug-mode *::after {
outline: 1px solid var(--debug-colour, red);
position: relative;
}
.debug-info {
position: absolute;
left: 50%;
transform: translateX(-50%);
font-family: 'Fira Code', monospace;
font-size: 1rem;
white-space: nowrap;
}
.debug-info.over { top: -2.5rem; }
.debug-info.under { bottom: -2.5rem; }
.debug-info p { margin: 0; }
[[iftags +component]]
This is a component to make the mobile sidebar button active on desktop-size screen.
To use, put the following:
[[include :scp-wiki:component:toggle-sidebar]]
If used with a theme, it's recommended to put said theme after this [[include]].
(Use this version by
Woedenaz if you're using Black Highlighter)
/* source: http://ah-sandbox.wikidot.com/component:collapsible-sidebar-x1 */
#top-bar .open-menu a {
position: fixed;
top: 0.5em;
left: 0.5em;
z-index: 5;
font-family: 'Lucida Sans Unicode','Lucida Grande','Lucida Sans','Times New Roman',Helvetica,Roboto,sans-serif;
font-size: 30px;
font-weight: 700;
width: 30px;
height: 30px;
line-height: 0.9em;
text-align: center;
border: 0.2em solid #888;
background-color: #fff;
border-radius: 3em;
color: #888;
pointer-events: auto;
}
@media not all and (max-width: 767px) {
#top-bar .mobile-top-bar {
display: block;
pointer-events: none;
}
#top-bar .mobile-top-bar li {
display: none;
}
#main-content {
max-width: 44.5rem;
margin: 0 auto;
padding: 0;
transition: max-width 0.2s ease-in-out;
}
#side-bar {
display: block;
position: fixed;
top: 0;
left: -18rem;
width: 15.25rem;
height: 100%;
margin: 0;
overflow-x: hidden;
overflow-y: auto;
z-index: 10;
padding: 1em 1em 0 1em;
background-color: rgba(0,0,0,0.1);
transition: left 0.4s ease-in-out;
scrollbar-width: thin;
}
#side-bar:target {
left: 0;
}
#side-bar:focus-within {
left: 0;
}
#side-bar:target .close-menu {
display: block;
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
margin-left: 17rem;
opacity: 0;
z-index: -1;
visibility: visible;
}
#side-bar:not(:target) .close-menu { display: none; }
#top-bar .open-menu a:hover {
text-decoration: none;
}
}
[[/iftags]]
这是什么?
这是一个能把当前页面上出现的wikidot用户信息变成Karma-5或者Karma 5 Pro的组件。你可以直观地从页面右上角的你的个人头像处看到效果。同时,你也可以尝试点进你的个人信息,然后你会发现弹窗上的个人信息也被修改了。
为了这个直观的效果我甚至没换版式,心在滴血啊。
使用方法
本组件有三种使用场景。
一
你只想要变更页面上一部分的用户信息,比如你在文章中引用了一两个[[user]],但你不想进行全局变更,例如右上角的用户头像。这种情况下,如果你只想变成Karma-5,插入以下include即可:
[[include :scp-wiki-cn:component:sticky-note-backend inc-5k-section=--]
]]
如果你想变成Karma 5 Pro,那么你需要同时插入以下include。注意必须是5k在前,pro在后:
[[include :scp-wiki-cn:component:sticky-note-backend inc-pro-section=--]
]]
然后,请用以下div块套住你想要改变的范围:
[[div class="karma-5-section"]]
[[div class="pro-section"]]
你的内容。不需要pro的话,就把[[div class="pro-section"]]和对应的[[/div]]去掉。
[[/div]]
[[/div]]
这样就ok了。
.karma-5-section .printuser>a:first-child img {
background-image: url(https://uploadfile.wikidot.com/local--files/component:5k-pro/5k.png) !important;
}
.karma-5-section td:has(img[src*="userkarma.php"]) img[src*="userkarma.php"] {
display: none;
}
.karma-5-section td:has(img[src*="userkarma.php"]) br {
display: none;
}
.karma-5-section td:has(img[src*="userkarma.php"]) {
display: flex;
align-items: center;
gap: 4px;
font-size: 0;
}
.karma-5-section td:has(img[src*="userkarma.php"]) a[href*="doc:karma"] {
font-size: 0.8rem;
line-height: 1;
}
.karma-5-section td:has(img[src*="userkarma.php"])::before {
content: "上师";
display: inline-block;
flex: 0 0 auto;
font-size: 0.8rem;
line-height: 16px;
color: inherit;
padding-right: 11px;
background-image: url("http://www.wikidot.com/common--theme/base/images/karma/karma_5.png");
background-repeat: no-repeat;
background-size: 7px 16px;
background-position: right center;
}
.karma-5-section .printuser>a:first-child img {
width: 34px;
padding: 0;
background-image: url(https://uploadfile.wikidot.com/local--files/component:5k-pro/5kpro.png) !important;
}
.pro-section .table tr:has(+ tr td img[src*="userkarma.php"]) > td:last-child {
display: flex;
align-items: center;
gap: 6px;
font-size: 0;
white-space: nowrap;
}
.pro-section .table tr:has(+ tr td img[src*="userkarma.php"]) > td:last-child img{
display: none;
}
.pro-section .table tr:has(+ tr td img[src*="userkarma.php"]) > td:last-child::before {
content: "Pro";
font-size: 0.8rem;
line-height: 1;
color: inherit;
}
.pro-section .table tr:has(+ tr td img[src*="userkarma.php"]) > td:last-child::after {
content: "";
width: 16px;
height: 16px;
flex: 0 0 auto;
background-image: url("https://d3g0gp89917ko0.cloudfront.net/v--7690939296dc/common--theme/base/images/karma/star.png");
background-size: contain;
background-repeat: no-repeat;
background-position: center;
}
二
你只想改变右上角的用户头像,不想进行全局变更,例如文章其他部分引用的用户。这种情况下,如果你只想变成Karma-5,插入以下include即可:
[[include :scp-wiki-cn:component:sticky-note-backend inc-5k-login-status=--]
]]
如果你想变成Karma 5 Pro,那么你需要同时插入以下include。注意必须是5k在前,pro在后:
[[include :scp-wiki-cn:component:sticky-note-backend inc-pro-login-status=--]
]]
然后就结束了。
#login-status .printuser>a:first-child img {
background-image: url(https://uploadfile.wikidot.com/local--files/component:5k-pro/5k.png) !important;
}
#login-status td:has(img[src*="userkarma.php"]) img[src*="userkarma.php"] {
display: none;
}
#login-status td:has(img[src*="userkarma.php"]) br {
display: none;
}
#login-status td:has(img[src*="userkarma.php"]) {
display: flex;
align-items: center;
gap: 4px;
font-size: 0;
}
#login-status td:has(img[src*="userkarma.php"]) a[href*="doc:karma"] {
font-size: 0.8rem;
line-height: 1;
}
#login-status td:has(img[src*="userkarma.php"])::before {
content: "上师";
display: inline-block;
flex: 0 0 auto;
font-size: 0.8rem;
line-height: 16px;
color: inherit;
padding-right: 11px;
background-image: url("http://www.wikidot.com/common--theme/base/images/karma/karma_5.png");
background-repeat: no-repeat;
background-size: 7px 16px;
background-position: right center;
}
#login-status .printuser>a:first-child img {
width: 34px;
padding: 0;
background-image: url(https://uploadfile.wikidot.com/local--files/component:5k-pro/5kpro.png) !important;
}
#login-status .table tr:has(+ tr td img[src*="userkarma.php"]) > td:last-child {
display: flex;
align-items: center;
gap: 6px;
font-size: 0;
white-space: nowrap;
}
#login-status .table tr:has(+ tr td img[src*="userkarma.php"]) > td:last-child img{
display: none;
}
#login-status .table tr:has(+ tr td img[src*="userkarma.php"]) > td:last-child::before {
content: "Pro";
font-size: 0.8rem;
line-height: 1;
color: inherit;
}
#login-status .table tr:has(+ tr td img[src*="userkarma.php"]) > td:last-child::after {
content: "";
width: 16px;
height: 16px;
flex: 0 0 auto;
background-image: url("https://d3g0gp89917ko0.cloudfront.net/v--7690939296dc/common--theme/base/images/karma/star.png");
background-size: contain;
background-repeat: no-repeat;
background-position: center;
}
页面版本: 7, 最后编辑于: 12 Apr 2026 12:19