波旁/萨斯:#{$ all-text-inputs}悬停还是专注? [英] Bourbon/Sass: #{$all-text-inputs} with hover or focus?

查看:77
本文介绍了波旁/萨斯:#{$ all-text-inputs}悬停还是专注?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据波旁文档,您可以使用 #{$all-text-inputs}将其转为

According to the Bourbon docs, you can use #{$all-text-inputs} to turn this:

#{$all-text-inputs} {
  border: 1px solid green;
}

对此:

input[type="email"], input[type="number"],   input[type="password"], input[type="search"],
input[type="tel"],   input[type="text"],     input[type="url"],      input[type="color"],
input[type="date"],  input[type="datetime"], input[type="datetime-local"],
input[type="month"], input[type="time"],     input[type="week"] {
  border: 1px solid green;
}

Bourbon或Sass是否可以将:hover:focus应用于每个对象?

Is there a way with Bourbon or Sass to apply :hover or :focus to each?

#{$all-text-inputs:hover}#{$all-text-inputs}:hover无效.

推荐答案

您应该能够使用Sass

You should be able to just nest the :hover and :focus styles using the Sass parent selector:

#{$all-text-inputs} {
  border: 1px solid green;
  &:hover, &:focus {
    // some styles
  }
}

这篇关于波旁/萨斯:#{$ all-text-inputs}悬停还是专注?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆