AI
如何在保留set -e的同时捕获函数的退出码?
关于 Bash get exit status of command when 'set -e' is active? 的回答展示了在set -e下捕获命令退出状态的不同方法。让我们来看看以下代码: myfunc() { false # set -e effect ignored return "$1" } set -e rc=0 myfunc 5 || rc=$? echo "myfunc exited with $rc" 这都很好,但实际上 set -e 在函数执行期间会被禁用。 我不想这样。 set
在排除preflight与 theme的情况下,`prefix()` 对 `tailwindcss/utilities.css` 不起作用
我在一个将嵌入到其他网站的小部件中使用TailwindCSS v4。由于这个原因,我想避免全局样式冲突,尤其是CSS归一化(normalize.css)。 因此,不去导入完整的TailwindCSS(包含主题和前置样式preflight),我只导入工具类: @import "tailwindcss/utilities" prefix(tw); 然而,似乎 prefix() 在这种情况下不起作用。在这种情况下,它只识别没有前缀的工具类。