【问题标题】:customizing rtl bootstrap5自定义 rtl bootstrap5
【发布时间】:2023-02-15 05:34:01
【问题描述】:

我想自定义 bootstrap 的 sass 文件,例如填充,但在 RTL 方向,但 bootstrap 没有 rtl sass 文件来更改填充并将其编译为 RTL CSS 文件任何人都可以帮助我该怎么做我不知道如何使用 rtlcss插件,包含 CSS 文件夹的图像,该文件夹是从 scss 编译的 CSS 但在 ltr 目录中

【问题讨论】:

    标签: sass bootstrap-5


    【解决方案1】:

    Bootstrap 5 docs 解释了如何支持 RTL。

    基本上你需要:

    1. 在元素上设置dir="rtl"
    2. <html> 元素上添加适当的 lang 属性,例如 lang="ar"
    3. 您还应该使用RTLCSS,安装方法如下:

      npm 安装 -g rtlcss

      在你编译文件之后

      $ rtlcss [option option=parameter ...] [source] [destination]

      例如将 input.css 转换为 output.rtl.css

      rtlcss 输入.css 输出.rtl.css

      编译后,你有一个 RTL 文件

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-10-29
      • 1970-01-01
      • 2021-09-22
      • 2021-07-17
      • 1970-01-01
      • 2023-03-04
      • 1970-01-01
      • 2020-02-14
      相关资源
      最近更新 更多