css - 是否可以使用手写笔混合返回选择器

标签 css stylus

在使用 scss 一段时间后,最近我一直在试用手写笔。我还没有找到用手写笔语法编写以下 scss 的方法。有没有人对此有任何解决方案。非常感谢任何想法。

@mixin attention() {
    &:hover,
    &:active,
    &:focus {
        @content;
    }
}

a {
    font-weight: bold;
    text-decoration: none;
    color: #c00;

    @include attention() {
        outline: none;
        color: #09f;
    }
}

最佳答案

这是可能的:https://learnboost.github.io/stylus/docs/mixins.html#block-mixins

attention() {
    &:hover,
    &:active,
    &:focus {
        {block}
    }
}

a {
    font-weight: bold;
    text-decoration: none;
    color: #c00;

    +attention() {
        outline: none;
        color: #09f;
    }
}

关于css - 是否可以使用手写笔混合返回选择器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32283614/

相关文章:

css - 当将图像放在 <p> 的中间时,将文本环绕在图像周围

html - CSS 上的文本顶部对齐

javascript - 不同父页面的不同样式表

stylus - 以编程方式设置手写笔变量

javascript - 使用 css2stylus 后手写笔文件出现无法加载资源错误

css - 使用手写笔优化 css

css - calc 不适用于手写笔和咕噜声

html - 表格在 Firefox 中错位

javascript - 我有一个适用于我的侧边导航的动画,但需要点击两次才能触发动画

css - 如何在 Stylus 中使用多个变量断点进行媒体查询?