寫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
耶,這工作。但是,如何反轉它,以便找到*最後*發生,而不是第一個? –