javascript - 获取scss文件中className的内容
问题描述
我有 scss 文件,我想解析它并获取我选择(动态)的类的内容,如果应该返回指定类的所有内容。
.styles-module--ctaArrow--JtKM2 {
position: relative;
display: inline-flex;
align-items: center;
margin-top: 55px;
width: 48px;
height: 38px;
transition: width .25s ease-in-out
}
@media (max-width: calc(992px - 1px)) {
.styles-module--ctaArrow--JtKM2 {
margin-top: 22px
}
}
.styles-module--ctaArrowLine--2Lcej {
display: inline-block;
width: calc(100% - 4px);
height: 4px;
background: #0058ff
}
.styles-module--ctaArrowIcon--1AFVc {
position: absolute;
top: 50%;
right: 0;
transform: translateY(-50%);
transition: right .25s ease-in-out
}
我想获取课程的styles-module--ctaArrowLine--2Lcej
内容
display: inline-block;
width: calc(100% - 4px);
height: 4px;
background: #0058ff
如果有任何 NPM 包会很棒。
解决方案
推荐阅读
- php - MAMP:无法加载动态库“php_intl.dll”Windows 10
- java - flink 是否为数据集批处理提供检查点
- ajax - 我如何在控制器之前检查 ajax 请求
- reactjs - 无法将多个复选框值发送到控制台
- flutter - 如何在 Flutter 中使用 SharedPreferences 和 Injectable?
- c++ - 如何在 gmock C++ 中模拟独立函数?
- swift - 无法在 Swift Playground 中获取 SKSpriteNode 的图像数据
- javascript - 元素出现后如何滚动到底部(使用react-slidedown)
- assembly - 位移值对 ModRegRm 字节的 Mod 字段有什么影响?
- reactjs - React js设置状态没有在状态对象中获得更新的值