V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
ShikiSuen
V2EX  ›  程序员

写出这种 CSS 「或判断」的语句,结果对 Chrome 系浏览器不生效。求解。

  •  
  •   ShikiSuen · 2020-05-05 11:17:41 +08:00 · 828 次点击
    这是一个创建于 1442 天前的主题,其中的信息可能已经有所发展或是发生改变。
    /* ==================== Emphasis Style Correction for CJK languages ==================== */
    :not(:not(:lang(zh)):not(:lang(ja)):not(:lang(ko))) {
    i, cite, em, var, address, dfn {font-style: normal;}
    .message-body i {border-bottom: dashed 1px @xf-paletteColor3 !important;}
    }


    以上脚本对 Safari 生效。
    ShikiSuen
        1
    ShikiSuen  
    OP
       2020-05-05 12:12:39 +08:00
    我写了另一套,结果无法通过 LESS 编译。

    .lang(@lang, @content) {
    &:lang(@{lang}){
    @content();
    };
    }

    .lang((zh) or (ja) or (ko), {
    i, cite, em, var, address, dfn {font-style: normal;}
    .message-body i {border-bottom: dashed 1px @xf-paletteColor3 !important;}
    });
    ShikiSuen
        2
    ShikiSuen  
    OP
       2020-05-05 14:16:00 +08:00
    我蠢得飞起。

    解决方案:直接用逗号。

    :lang(zh), :lang(ja), :lang(ko){
    i, cite, em, var, address, dfn {font-style: normal;}
    .message-body i {border-bottom: dashed 1px @xf-paletteColor3 !important;}
    }
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1396 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 23:51 · PVG 07:51 · LAX 16:51 · JFK 19:51
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.