Skip to main content

Command Palette

Search for a command to run...

tailwindcss variables not working in Chrome extension

Published
1 min read

How to fix it

/* If your code is like this in global.css */
@layer base {
    :root {
        --background: 0 0% 100%;
        --foreground: 222.2 47.4% 11.2%;
        /* 
        ...
        */
    }
}

/* Try this instead: 'Change :root to :host' */
@layer base {
    :host {
        --background: 0 0% 100%;
        --foreground: 222.2 47.4% 11.2%;
        /* 
        ...
        */
    }
}

More from this blog

Python实现长度16位十进制整数的客制化雪花算法(Snowflake)生成器

前言 Javascript 整数表达最大为 2^53-1 位,大约是十进制16位,超过就会导致精度丢失,一般在浏览器中会直接报错。 场景 我们知道,雪花算法(SnowFlake)生成的雪花ID是 2^64 位,如果直接使用雪花算法(SnowFlake)生成器,前端是没办法直接拿到int类型的雪花ID,需要后端先将其转换为string类型才行。 使用雪花算法(SnowFlake)的很重要一个原因就是,int类型对数据库索引是很友好的,为了前后端数据交互方便,在数据库中直接储存string类型的雪花...

Dec 28, 20222 min read478
A

Asiones Jia's blog

5 posts