注意:
此页为于后室维基内部所使用的组件页面。该页面内容可在其它页面中被使用或引用。
这是什么
我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; }
这是什么?
这个组件可以改变侧栏的显示状态,使其变为默认展开。
此组件可以与黑标切换侧边栏组件联合使用,以取得与网站的移动端版本类似的外观。
使用方法:
若需使用本组件,请在你页面的任意位置插入以下代码:
[[include :backrooms-wiki-cn:component:unfold-sidebar]]
/* Unfold Sidebar */ /* By Mercuresphere */ :root { --toggle-button-bg: rgb(var(--swatch-menubg-color)); --toggle-border-color: rgb(var(--swatch-border-color)); --toggle-border-width: 0.25rem; --toggle-icon-color: rgb(var(--sidebar-links-text)); --toggle-roundness: 50%; } @media only screen and (min-width: 769px) { #content-wrap { max-width: unset; display: grid; position: static; grid-template-columns: calc(var(--sidebar-width-on-desktop)) calc(50% - var(--body-width-on-desktop)/2 - var(--sidebar-width-on-desktop)*3/2) 1fr calc(50% - var(--body-width-on-desktop)/2 - var(--sidebar-width-on-desktop)/2); grid-template-areas: "side-bar . content"; grid-area: content-wrap; flex-grow: 2; flex-direction: column; margin: 0 auto; width: 100%; height: auto; min-height: calc(100vh - var(--final-header-height-on-desktop)); } #main-content { position: unset; max-height: unset; display: grid; grid-template-rows: auto; grid-template-columns: repeat(auto-fit, minmax(100%, 1fr)); grid-template-areas: "action-area-top" "page-title" "breadcrumbs" "page-content" "page-tags" "page-info-break" "page-options" "action-area-btm"; grid-area: content; flex-basis: var(--body-width-on-desktop); margin: 0 auto; background-color: transparent; padding: 2rem 1rem; width: calc(100% - 3rem); max-width: var(--body-width-on-desktop); } #side-bar { transform: unset; transform: unset; transition: unset; width: unset; min-width: unset; grid-area: unset; padding-right: unset; top: unset; max-height: unset; position: unset; left: unset; padding-left: unset; scrollbar-width: unset; overscroll-behavior: unset; scrollbar-color: unset; direction: rtl; height: calc(100vh + 2rem); background-color: rgba(var(--swatch-menubg-color, 255, 255, 255), 1); } #side-bar::-webkit-scrollbar-thumb { background-color: rgba(170, 170, 170, 1); } #side-bar:hover::-webkit-scrollbar-track { background: rgba(var(--swatch-tertiary-color), .05); } #side-bar:hover, #side-bar:active { padding-right: unset; margin-right: unset; transform: unset; transform: unset; overflow-y: unset; scrollbar-color: unset; } #side-bar:focus-within { padding-right: unset; margin-right: unset; transform: unset; transform: unset; overflow-y: unset; scrollbar-color: unset; } #main-content::after { content: unset; position: unset; display: unset; align-items: unset; justify-content: unset; width: unset; height: unset; max-height: unset; top: unset; transition: unset; left: unset; background: unset; background-repeat: unset; background-position: unset; background-attachment: unset; background-size: unset; pointer-events: unset; } #side-bar:hover+#main-content::after, #side-bar:active+#main-content::after { left: unset; left: unset; background-position: unset; background-position: unset; transition: unset; opacity: unset; width: unset; font-size: unset; } #side-bar:focus-within+#main-content::after { left: unset; left: unset; background-position: unset; background-position: unset; transition: unset; opacity: unset; width: unset; font-size: unset; } #main-content::before { --not-ie: unset; content: unset; background-color: unset; background-color: unset; position: unset; position: unset; top: unset; top: unset; left: unset; transform: unset; transform: unset; width: unset; width: unset; height: unset; height: unset; transition: unset; opacity: unset; pointer-events: unset; z-index: unset; margin-bottom: unset; margin-bottom: unset; } #side-bar:hover+#main-content::before, #side-bar:active+#main-content::before { transform: unset; opacity: unset; } #side-bar:focus-within+#main-content::before { transform: unset; opacity: unset; } #side-bar .side-block { margin-top: unset; background-color: unset; border-radius: unset; border-left-width: unset; border-right-width: unset; direction: ltr; } @supports (-ms-ime-align: auto) { #side-bar { overflow-y: unset; overflow-x: unset; transform: unset; } #side-bar:hover, #side-bar:active { overflow-y: unset; transform: unset; margin-left: unset; } #side-bar:focus-within { overflow-y: unset; transform: unset; margin-left: unset; } #main-content::before { left: unset; transform: unset; } } }