如何在 vscode 中将 css 十六进制转换为大写?
How to tranform css hex to uppercase in vscode?
我正在使用 vscode prettier, and I was told that hex value should be uppercase as company's standard. I've been through a search and I found their github-issue
也就是说,
" Personally I prefer uppercase too, but I was asked to do lowercase... But changing this would cause a lot of unnecessary churn for all Prettier users... this decision has been made and is not going to change. An option won't be added." - Sep. 29,2018
所以基本上,prettier 将十六进制值转换为小写,并且不提供将其更改为大写的选项。
我想问一下,他们现在改变了他们的决定并选择将 css 十六进制值转换为大写吗?如果在 prettier 中没有真正的选择,是否有任何替代方法可以实现这一点?
我使用的基本替代方案是 @rioV8 的想法,但是我更愿意使用 替换字段 而不是 转换为大写 ,我觉得这样会更快。
我想提供这个作为答案,因为它至少有效。
在vscode中使用正则表达式找到#(?:[0-9a-fA-F]{3}){1,2}
,并将其替换为\U[=11=]
。
我正在使用 vscode prettier, and I was told that hex value should be uppercase as company's standard. I've been through a search and I found their github-issue 也就是说,
" Personally I prefer uppercase too, but I was asked to do lowercase... But changing this would cause a lot of unnecessary churn for all Prettier users... this decision has been made and is not going to change. An option won't be added." - Sep. 29,2018
所以基本上,prettier 将十六进制值转换为小写,并且不提供将其更改为大写的选项。
我想问一下,他们现在改变了他们的决定并选择将 css 十六进制值转换为大写吗?如果在 prettier 中没有真正的选择,是否有任何替代方法可以实现这一点?
我使用的基本替代方案是 @rioV8 的想法,但是我更愿意使用 替换字段 而不是 转换为大写 ,我觉得这样会更快。
我想提供这个作为答案,因为它至少有效。
在vscode中使用正则表达式找到#(?:[0-9a-fA-F]{3}){1,2}
,并将其替换为\U[=11=]
。