Hello, everyone.
How to edit in userstyle.css to achieve the effect as an image?
你是想说如何写CSS才能让checkbox获得图中所示样式?
Did you mean that how to write CSS to make checkboxes look like what the image shows?
/* Base for label styling */
li.md-checkbox [type="checkbox"]:not(:checked),
li.md-checkbox [type="checkbox"]:checked {
position: absolute;
left: -9999px;
}
li.md-checkbox [type="checkbox"]:not(:checked) + label,
li.md-checkbox [type="checkbox"]:checked + label {
position: relative;
padding-left: 1.5em;
cursor: pointer;
}
/* checkbox aspect */
li.md-checkbox [type="checkbox"]:not(:checked) + label:before,
li.md-checkbox [type="checkbox"]:checked + label:before {
content: '';
position: absolute;
left: 0; top: 0;
width: 1em; height: 1em;
border: 1px solid #ccc;
background: #fff;
border-radius: 1px;
}
/* checked mark aspect */
li.md-checkbox [type="checkbox"]:not(:checked) + label:after,
li.md-checkbox [type="checkbox"]:checked + label:after {
content: '\2713\0020';
position: absolute;
top: .3em; left: .3em;
font-size: .9em;
line-height: 0.8;
transition: all .2s;
font-family: 'Lucida Sans Unicode', 'Arial Unicode MS', Arial;
}
/* checked mark aspect changes */
li.md-checkbox [type="checkbox"]:not(:checked) + label:after {
opacity: 0;
transform: scale(0);
}
li.md-checkbox [type="checkbox"]:checked + label:after {
opacity: 1;
transform: scale(1);
}
1 Like
不行。我其实是想要模仿 Evernote 的复选框样式 :(
1 Like
还是不行。这是我的全部css内容。
/* For styling the rendered Markdown */
body{
font-family:"Noto Sans CJK SC";
font-size: 16px;
color: #000000;
line-height: 1.45
}
mark {
background: #fff9a6 !important;
padding: 1px 3px;
}
a .resource-icon {
display: none;
}
a[href='#'] {
color: #69a932;
}
a{
color: #0014ed;
}
p {
font-size: 16px;
}
body, th, td, .inline-code {
font-size: 16px;
}
hr {
border: 1px solid #999999;
}
h1, h2, h3, h4, h5, h6 {
margin: 10px 0 10px;
padding: 0;
font-weight: bold;
-webkit-font-smoothing: antialiased;
cursor: text;
position: relative; }
h1 {
font-size: 28px !important;
color: black;
border-bottom: none
}
h2 {
font-size: 24px !important;
color: black;
}
h3 {
font-size: 18px;
}
h4 {
font-size: 16px;
}
h5 {
font-size: 14px; }
h6 {
color: #777777;
font-size: 14px; }
.inline-code {
border: 1px solid #3b3b3b;
border-radius: 2px;
background-color: #e8e8e8;
padding: 0;
padding: 4px 4px 4px 4px;
color: #000000;
font-size: 1em;
}
.hljs {
border: 1px solid #3b3b3b;
border-radius: 2px;
background-color: #e8e8e8;
padding: 0;
padding: 2px 4px 0px 4px;
font-size: 1em;
}
.hljs-keyword, .hljs-symbol, .hljs-number, .hljs-built_in, .hljs-string {
color: #000000;
}
code {
font-family: Noto Sans CJK SC;
background-color: #e8e8e8;
color: #000000;
padding: 0 2px 0 2px;
}
pre {
overflow: auto;
white-space: pre;
white-space: pre-wrap;
word-wrap: break-word;
}
blockquote {
border-left: 11px solid #3b3b3b;
background-color: #e8e8e8;
color: #000000;
padding: 0.5em 15px;
margin: 15px 0;
opacity: 1;
}
blockquote > :first-child {
margin-top: 0; }
blockquote > :last-child {
margin-bottom: 0; }
/* Base for label styling */
li.md-checkbox [type="checkbox"]:not(:checked),
li.md-checkbox [type="checkbox"]:checked {
position: absolute;
left: -9999px;
}
li.md-checkbox [type="checkbox"]:not(:checked) + label,
li.md-checkbox [type="checkbox"]:checked + label {
position: relative;
padding-left: 1.5em;
cursor: pointer;
}
/* checkbox aspect */
li.md-checkbox [type="checkbox"]:not(:checked) + label:before,
li.md-checkbox [type="checkbox"]:checked + label:before {
content: '';
position: absolute;
left: 0; top: 0;
width: 1em; height: 1em;
border: 1px solid #ccc;
background: #fff;
border-radius: 1px;
}
/* checked mark aspect */
li.md-checkbox [type="checkbox"]:not(:checked) + label:after,
li.md-checkbox [type="checkbox"]:checked + label:after {
content: '\2713\0020';
position: absolute;
top: .3em; left: .3em;
font-size: .9em;
line-height: 0.8;
transition: all .2s;
font-family: 'Lucida Sans Unicode', 'Arial Unicode MS', Arial;
}
/* checked mark aspect changes */
li.md-checkbox [type="checkbox"]:not(:checked) + label:after {
opacity: 0;
transform: scale(0);
}
li.md-checkbox [type="checkbox"]:checked + label:after {
opacity: 1;
transform: scale(1);
}
我把CSS换成你的之后也可以生效。可能是版本问题?我的是最新版
Joplin 1.0.201 (prod, win32)
Client ID: 97bf3e8d9de64968b1b1965cbeafc9a3
Sync Version: 1
Profile Version: 28
Revision: e65af8c1 (master)
我的也是这个版本。是便携版。不会是这个原因?:(