写CSS的一种流行方式是像这样:疯狂的正则表达式:追加以前CSS选择器
#report-page aside.sidebar {
…
}
#report-page aside.sidebar li {
…
}
#report-page aside.sidebar li a {
…
它变得乏味写这个。我想尝试自动化重复的部分。 (一样都不能少预处理程序解决这个问题,但我不能在这个现有应用中使用它。)
Espresso.app可以插入一个动态文本片段:
<!-- The matched suffix allows you to capture information about the text
preceding the insertion point. Specify a regular expression here. -->
<matched-suffix>(\s+)(is a vegetable)?</matched-suffix>
<!-- The transform-into element is a regex replacement expression, and can use
the captured strings from matched-suffix to generate a conditional snippet. -->
<transform-into>(?2:\1is a vegetable:\1is fantastic and)</transform-into>
你能不能帮我写的正则表达式查找第一个大括号{
,并返回该行之前的任何内容,不包括制表符和空格?
SASS使用Espresso的自动完成和语法高亮显示功能。为了减轻这种压力,Espresso的扩展很快就写下来了。 –
您是否尝试过使用SCSS? – arnaud576875
耶,这工作。但是,如何反转它,以便找到*最后*发生,而不是第一个? –