Bootstrap _reboot.scss覆盖PrimeNG样式

dm7nw8vv  于 2023-10-14  发布在  Bootstrap
关注(0)|答案(1)|浏览(151)

Bootstrap似乎覆盖了我的PrimeNG样式,更具体地说是覆盖了它的_reboot.scss文件。我已经在我的styles.scss和angular.json中引用了它。我做了一些调查,我看到它在香草设置中得到修复,只是html,而不是在一个Angular 的环境中。
在我的styles.scss中,我在顶部有以下内容:

@import 'modern-normalize/modern-normalize.css';
@import "bootstrap/dist/css/bootstrap.css";
@import 'bootstrap-icons/font/bootstrap-icons';
@import "primeicons/primeicons.css";
@import "primeflex/primeflex.css";
@import "primeng/resources/primeng.min.css";

然后在我的angular.json中,我有以下内容:

"styles": [
    "modern-normalize/modern-normalize.css",
    "bootstrap-icons/font/bootstrap-icons.css",
    "bootstrap/dist/css/bootstrap.css",
    "primeicons/primeicons.css",
    "primeflex/primeflex.css",
    "primeng/resources/primeng.min.css",
    "src/styles.scss",
    {
        "input": "src/theme-light.scss",
        "bundleName": "light",
        "inject": false
    },
    {
        "input": "src/theme-dark.scss",
        "bundleName": "dark",
        "inject": false
    }
],
4ngedf3f

4ngedf3f1#

尝试替换样式顶部的primeng并检查

@import "primeicons/primeicons.css";
@import "primeflex/primeflex.css";
@import "primeng/resources/primeng.min.css";
@import 'modern-normalize/modern-normalize.css';
@import "bootstrap/dist/css/bootstrap.css";
@import 'bootstrap-icons/font/bootstrap-icons';

相关问题