jupyter 代码样式

参考:https://blog.csdn.net/qq_42247018/article/details/113094031

在css文件添加以下内容:



/* Body */
/* #notebook-container {
    width: 90%
} */

/* Markdown */
div#notebook {
    font-family: san francisco, "PingFangSC-Medium", "Microsoft YaHei";
    line-height: 20px;
    -webkit-font-smoothing: antialiased !important;
}

/* Markdown - h2 */
div#notebook h2 {
    color: #007aff;
}

/* Markdown - quote */
div#notebook blockquote{
    background-color: #f8f8f8;
    color: #505050;
    padding: 8.5px;
    margin: 0.5em -0.5em 0.5em -0.4em;
}

/* Markdown - code in paragraph */
div#notebook p code, div#notebook li code {
    font-family: Consolas, "PingFangSC-Medium", "Microsoft YaHei";
    font-size: 1em !important;
    color: #111111;
    border: 0.5px solid #cfcfcf;
    border-radius: 2px;
    background-color: #f7f7f7;
    padding: .1em .2em;
    margin: 0px 2px;
}

/* Markdown - code */
div.text_cell_render pre {
    border: 1px solid #cfcfcf;
    border-radius: 2px;
    background: #f7f7f7;
    line-height: 1.21429em;
    padding: 8.5px;
    margin: 0.5em -0.5em 0.5em -0.4em;
}
div.text_cell_render code {
    background: #f7f7f7;
}

/* Code */
div.CodeMirror pre {
    font-family: Consolas, "PingFangSC-Medium", "Microsoft YaHei";
    font-size: 11pt;
    line-height: 140%;
    -webkit-font-smoothing: antialiased !important;
}

/* Code - output */
div.output pre {
    font-family: Consolas, "PingFangSC-Medium", "Microsoft YaHei";
    line-height: 20px;
    -webkit-font-smoothing: antialiased !important;
}

/* Code - comment */
span.cm-comment {
    font-family: san francisco, "PingFangSC-Medium", "Microsoft YaHei" !important;
    font-style: normal !important;
}2. Mac/* Body */
/* #notebook-container {
    width: 90%
} */

/* Markdown - h2 */
div#notebook h2 {
    color: #007aff;
}

/* Markdown - quote */
div#notebook blockquote{
    background-color: #f8f8f8;
    color: #505050;
    padding: 8.5px;
    margin: 0.5em -0.5em 0.5em -0.4em;
}

/* Markdown - code in paragraph */
div#notebook p code, div#notebook li code {
    font-size: 1em !important;
    color: #111111;
    border: 0.5px solid #cfcfcf;
    border-radius: 2px;
    background-color: #f7f7f7;
    padding: .1em .2em;
    margin: 0px 2px;
}

/* Markdown - code */
div.text_cell_render pre {
    border: 1px solid #cfcfcf;
    border-radius: 2px;
    background: #f7f7f7;
    line-height: 1.21429em;
    padding: 8.5px;
    margin: 0.5em -0.5em 0.5em -0.4em;
}
div.text_cell_render code {
    background: #f7f7f7;
}

/* Code */
div.CodeMirror pre {
    line-height: 140%;
}


/* Code - comment */
span.cm-comment, span.c1 {
    font-style: normal !important;
}



/* Code - highlighting */
.cm-s-ipython .CodeMirror-cursor {
    border-left: 1px solid #ff711a !important;
}
.cm-s-ipython span.cm-comment, span.c1 {
    color: #8d8d8d !important;
}
.cm-s-ipython span.cm-atom {
    color: #055be0 !important;
}
.cm-s-ipython span.cm-number, span.mi {
    color: #ff8132 !important;
}
.cm-s-ipython span.cm-property {
    color: #303030 !important;
}
.cm-s-ipython span.cm-attribute {
    color: #303030 !important;
}
.cm-s-ipython span.cm-keyword, span.kn, span.k, span.ow, span.kc, span.bp {
    color: #713bc5 !important;
    font-weight: 520 !important;
}
.cm-s-ipython span.cm-string, span.s1, span.s2 {
    color: #009e07 !important;
}
span.se, span.si {
    color: #59c08d !important;
    font-weight: normal !important;
}
.cm-s-ipython span.cm-meta {
    color: #aa22ff !important;
}
.cm-s-ipython span.cm-operator, span.o {
    color: #055be0 !important;
    font-weight: bold !important;
}
.cm-s-ipython span.cm-builtin, span.nb {
    color: #e22978 !important;
}
.cm-s-ipython span.cm-variable, span.nn, span.n {
    color: #303030 !important;
    font-weight: normal !important;
}
.cm-s-ipython span.cm-variable-2 {
    color: #de143d !important;
}
.cm-s-ipython span.cm-variable-3 {
    color: #aa22ff !important;
}
.cm-s-ipython span.cm-def {
    color: #e22978 !important;
    font-weight: normal !important;
}
.cm-s-ipython span.cm-error {
    background: rgba(191, 97, 106, .40) !important;
}
.cm-s-ipython span.cm-tag {
    color: #e22978;
}
.cm-s-ipython span.cm-link {
    color: #ff8132 !important;
}
.cm-s-ipython span.cm-storage {
    color: #055be0 !important;
}
.cm-s-ipython span.cm-entity {
    color: #e22978 !important;
}
.cm-s-ipython span.cm-quote {
    color: #009e07 !important;
}
div.CodeMirror span.CodeMirror-matchingbracket {
    color: #1c1c1c !important;
    background-color: rgba(30, 112, 199, .30) !important;
}
div.CodeMirror span.CodeMirror-nonmatchingbracket {
    color: #1c1c1c !important;
    background: rgba(191, 97, 106, .40) !important;
}
.cm-s-default .cm-hr {
    color: #055be0 !important;
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值