我找不到减少输入窗口宽度的方法。我没有看到或找到任何控制输入窗口宽度的代码。下面的代码取自Bootstrap v5 文档,来自表单元素。
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous" />
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
<form>
<div class="input-group mb-3">
<span class="input-group-text">@</span>
<input type="email" id="email" class="form-control" placeholder="Your email" aria-label="Email" aria-describedby="basic-addon1" />
<button type="submit" class="btn btn-primary btn-md">Sign up</button>
</div>
</form>
Run Code Online (Sandbox Code Playgroud)
我第一次使用 创建了一个新的 Next.js 项目create-next-app
,并成功使用 运行它npm run dev
。
问题是每次 Next.js 启动时,它都会说:
FetchError: request to https://fonts.gstatic.com/s/inter/v12/UcC73FwrK3iLTeHuS_fvQtMwCp50KnMa1ZL7W0Q5nw.woff2 failed, reason:
at ClientRequest.<anonymous> (C:\Users\user\Desktop\documents\node_modules\next\dist\compiled\node-fetch\index.js:1:65756)
at ClientRequest.emit (node:events:511:28)
at TLSSocket.socketErrorListener (node:_http_client:495:9)
at TLSSocket.emit (node:events:511:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
type: 'system',
errno: 'ENETUNREACH',
code: 'ENETUNREACH'
}
- error Failed to download `Inter` from Google Fonts. Using fallback font instead.
Run Code Online (Sandbox Code Playgroud)
我的目标是让 Next.js 使用实际字体而不是后备字体。
我不知道为什么会发生这种情况,因为我还没有更改 Next.js 中的任何内容。即使在我的浏览器中打开 URL 也https://fonts.gstatic.com/s/inter/v12/UcC73FwrK3iLTeHuS_fvQtMwCp50KnMa1ZL7W0Q5nw.woff2
能正常工作,所以我想这不是网络问题。
我尝试在Next.js文档中搜索,但没有找到任何重复项。
这是layout.tsx
位于里面的src/app/
: …
Tailwind CSS 提供了两种不同的方式在您的网站上启用深色模式。
第一种方式是通过媒体,这意味着您的操作系统是否支持暗模式并且已激活。您的网站将自动以深色模式显示。
我的tailwind.config.js
:
module.exports = {
darkMode: 'media',
};
Run Code Online (Sandbox Code Playgroud)
第二种方法是通过“class”,这意味着您的<html>
标签是否已class="dark"
分配。您的网站将以深色模式显示。
我的tailwind.config.js
:
module.exports = {
darkMode: 'class',
};
Run Code Online (Sandbox Code Playgroud)
有没有一种简单的方法可以同时使用这两个选项?
我想要实现的效果是用户可以在“亮”、“暗”和“系统设置”之间设置自己的偏好。
与 Stack Overflow 上使用的函数类似:
如果 Tailwind CSS 目前无法实现此选项,那么最干净、最简单的解决方法是什么?
有关我的项目的信息:
我知道在CSS中,你可以设置min-height
and max-width
,但是当我尝试时,min-h-10
它max-h-10
在Tailwind CSS中没有做任何事情。
这就是我所拥有的:
<div class="flex-col justify-center">
<div class="h-10 w-10 border bg-blue-300 block">
h
</div>
</div>
Run Code Online (Sandbox Code Playgroud) 如何将动态长文本与另一个小部件(如按钮)连续展开,如下所示:
我尝试了一下Expanded
,Flexible
但Warp
没有得出结论。
!注意我不希望这个在 aStack
或Padding
从底部使用!导致该文本会发生变化,其长度可能会变大或变短。
更新:我尝试使用 ExtendedText,但 TextOverFlowWidget 的子项没有显示给我。我的代码:
Container(
color: Colors.amber,
height: 70,
child: ExtendedText(
'bbbbb ${toPhoneStyle(widget.inputPhone)} (${widget.selectedCountry.dialCode}) aaaaaa aaaaaaaaaaa',
overflowWidget: TextOverflowWidget(
// maxHeight: double.infinity,
// align: TextOverflowAlign.right,
// fixedOffset: Offset.zero,
child: Container(
width: 60,
height: 60,
color: Colors.red,
),
),
),
),
Run Code Online (Sandbox Code Playgroud)
但是如果像这样缩小容器的高度height:20
,则显示如下:
我想将标签文本移动到该topLeft
位置。
从这,到这。
代码:
Container buildPendingPageTextField() {
return Container(
alignment: Alignment.topLeft,
width: MediaQuery.of(context).size.width,
child: TextField(
textAlign: TextAlign.start,
controller: attendanceBloc.refusedReasonController,
textInputAction: TextInputAction.done,
maxLines: 3,
minLines: 3,
scrollPhysics: ScrollPhysics(),
style: TextStyle(
height: 1,
fontSize: 15,
letterSpacing: -0.5,
),
decoration: InputDecoration(
errorText: attendanceBloc.error.value,
floatingLabelBehavior: FloatingLabelBehavior.never,
labelText: "Descreva aqui o motivo",
labelStyle: TextStyle(),
border: const OutlineInputBorder(
borderSide: BorderSide(
color: Colors.grey,
width: 0.3,
),
),
),
),
);
}
Run Code Online (Sandbox Code Playgroud)
我尝试过在容器上对齐。上inputDecoration
,甚至上textStyle
,都没有成功。
我在 MSYS 2 下运行 autogen.sh 脚本。
到目前为止,我安装了所有请求的软件包,但是
checking for glib-gettext >= 2.2.0...
testing glib-gettextize... not found.
Run Code Online (Sandbox Code Playgroud)
我不明白。
命名的包glib-getext
不存在。
我跑:
pacman -S glib2
Run Code Online (Sandbox Code Playgroud)
但没有成功。
我也运行:
$ pacman -S gettext
Run Code Online (Sandbox Code Playgroud)
希望能解决我的问题,但事实并非如此。
我该怎么办glib-gettext
?
css ×2
flutter ×2
html ×2
javascript ×2
tailwind-css ×2
bootstrap-5 ×1
dart ×1
google-fonts ×1
laravel-8 ×1
msys2 ×1
next.js ×1
php ×1
text ×1
typescript ×1
warp ×1
widget ×1