小编hus*_*sky的帖子

如何在 TailwindCSS 中使元素在移动设备尺寸中不可见,但在笔记本电脑尺寸中可见

在 tailwind css 中,我们可以说lg:hidden隐藏 lg 尺寸屏幕中的元素。

在下面的示例中,我们没有指定屏幕尺寸,因此01对任何屏幕都完全隐藏。

<div class="flex ...">
  <div class="hidden ...">01</div>
  <div>02</div>
  <div>03</div>
</div>
Run Code Online (Sandbox Code Playgroud)

我想实现只显示lg尺寸元素但隐藏移动尺寸。然而,tailwind css断点是基于min width所以如果我们指定sm:hidden,例如,从768px开始的最小宽度都被隐藏。

有什么办法可以只显示特定屏幕尺寸的元素,但在 Tailwind CSS 中隐藏在该屏幕尺寸以下?

css tailwind-css

46
推荐指数
5
解决办法
6万
查看次数

如何从列表中删除项目并返回新列表而不在颤动中删除项目

我有一个字符串列表,因为List<String> temp = ['a', 'b', 'c', 'd']; 我想修改和删除列表中的特定项目并返回没有删除项目的新列表。

例如,如果我想删除索引 2,我想要得到的是['a', 'b', 'd'] removeAt行不通的,因为它只返回删除的字符串项...

list dart flutter

12
推荐指数
2
解决办法
2万
查看次数

自定义字体在 TailwindCSS 和 ReactJS 项目中不起作用

我在 React/TypeScript/TailWind/NextJS 项目中使用自定义字体。我将字体存储在/fonts文件夹中为Glimer-Regular.ttf.

然后在我的global.css声明中如下。

@layer base {

    @font-face {
        font-family: '"Glimer"';
        src: url(../../fonts/Glimer-Regular.ttf) format('ttf');
    }
}


Run Code Online (Sandbox Code Playgroud)

在我的tailwind.config.js文件中,我添加了如下字体系列。

module.exports = {
    mode: 'jit',
    important: true,

    purge: ['./src/pages/**/*.{js,ts,jsx,tsx}'],
    darkMode: false,
    content: [],
    theme: {
        extend: {
            fontFamily: {
                glimer: ['"Glimer"']
            },
Run Code Online (Sandbox Code Playgroud)

这应该可以工作,但字体仍然是默认的并显示serif-400。我仍然可以在家庭部分看到Glimer,但字体似乎没有改变。我有什么遗漏的吗? 在此输入图像描述

fonts typescript reactjs next.js tailwind-css

6
推荐指数
1
解决办法
2万
查看次数

如何使用 golang-migrate 进行迁移

我有一个简单的应用程序,使用 golang-migrate/migrate 和 postgresql 数据库。但是,我认为当我调用函数时会收到错误,Migration因为我的 sourceURL 或 databaseURLmigrate.New()是无效的内存地址或 nil 指针。

但我不确定为什么我的sourceURL或databaseURL会导致错误-我将sourceURL存储为file:///database/migration存储sql文件的目录,将databaseURL存储为postgres://postgres:postgres@127.0.0.1:5432/go_graphql?sslmode=disable在我的Makefile中定义的目录。

我的Makefile是这样的

migrate:
    migrate -source file://database/migration \
            -database postgres://postgres:postgres@127.0.0.1:5432/go_graphql?sslmode=disable up

rollback:
    migrate -source file://database/migration \
            -database postgres://postgres:postgres@127.0.0.1:5432/go_graphql?sslmode=disable down

drop:
    migrate -source file://database/migration \
            -database postgres://postgres:postgres@127.0.0.1:5432/go_graphql?sslmode=disable drop

migration:
    migrate create -ext sql -dir database/migration go_graphql

run:
    go run main.go

Run Code Online (Sandbox Code Playgroud)

然后,我的main.go就像下面这样。

func main() {
    ctx := context.Background()

    config := config.New()

    db := pg.New(ctx, config)
    println("HEL")

    if err := db.Migration(); err …
Run Code Online (Sandbox Code Playgroud)

postgresql go golang-migrate

3
推荐指数
1
解决办法
7421
查看次数