无法覆盖Angular 7应用程序中的引导
在angular应用程序中,我试图通过移除分隔器来覆盖我的无法覆盖Angular 7应用程序中的引导,angular,twitter-bootstrap,sass,angular7,Angular,Twitter Bootstrap,Sass,Angular7,在angular应用程序中,我试图通过移除分隔器来覆盖我的面包屑。我使用https://getbootstrap.com/docs/4.2/components/breadcrumb/#example 但这不管用。这是我的angular.json { "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "version": 1, "newProjectRoot": "projects", "pr
面包屑。我使用https://getbootstrap.com/docs/4.2/components/breadcrumb/#example
但这不管用。这是我的angular.json
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"ibo": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"prefix": "app",
"schematics": {
"@schematics/angular:component": {
"styleext": "scss"
}
},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/ibo",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"stylePreprocessorOptions": {
"includePaths": [
"node_modules/bootstrap",
"src/styles"
]
},
"scripts": [
"node_modules/popper.js/dist/umd/popper.min.js",
"node_modules/jquery/dist/jquery.min.js",
"node_modules/bootstrap/dist/js/bootstrap.min.js"
],
"styles": [
"node_modules/font-awesome/css/font-awesome.min.css",
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"src/styles/styles.scss",
],
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "ibo:build"
},
"configurations": {
"production": {
"browserTarget": "ibo:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "ibo:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js",
"styles": [
"src/styles.scss"
],
"scripts": [],
"assets": [
"src/favicon.ico",
"src/assets"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
},
"ibo-e2e": {
"root": "e2e/",
"projectType": "application",
"prefix": "",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "ibo:serve"
},
"configurations": {
"production": {
"devServerTarget": "ibo:serve:production"
}
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": "e2e/tsconfig.e2e.json",
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"defaultProject": "ibo"
}
my style.scss:
@import '~bootstrap/scss/_functions.scss';
@import '~bootstrap/scss/_variables.scss';
@import '~bootstrap/scss/mixins/_breakpoints.scss';
@import 'global.scss';
$grid-breakpoints: (
sm: 768px,
md: 768px,
lg: 1024px
);
$container-min-widths: (
sm: 768px,
md: 768px,
lg: 1024px
);
//resets;-
html,body{
padding: 0;
margin: 0;
height: 100%;
}
.wrapper.container-fluid{
min-height: 100%;
padding:0;
margin: 0;
}
$breadcrumb-divider: none !important;
有人帮我吗?提前感谢。使用angular.json加载bootstrap.css,而不是导入或使用CDN作为引导样式,如下所示。顺序应该先是bootstrap.css,然后是style.css
"styles": [
"../node_modules/bootstrap/dist/css/bootstrap.min.css",
"src/styles/styles.scss",
],
您可以使用下面的css覆盖分隔符。这不会覆盖引导变量
.breadcrumb>li+li:before {
padding: 0 5px;
color: #ccc;
content: "";
}
要覆盖引导变量,请将“$breadcrumb divider:none;”放在style.scss的顶部
从angular.json中删除bootstrap.min.css
....
"styles": [
"node_modules/font-awesome/css/font-awesome.min.css",
"src/styles/styles.scss",
],
....
导入bootstrap.scss
文件
@import "~bootstrap/scss/bootstrap";
在@import
语句之前设置$breadcrumb divider
$breadcrumb-divider: none;
@import "~bootstrap/scss/bootstrap";
...
打开angular.json
将“extractCss”:true
更改为“extractCss”:false
可以解决此问题
尝试添加!重要信息
可能是helps@JohnVelasquez-但医生没有这么说。仍在尝试,未成功您是否将此导入到样式中。scss
?尝试将$breadcrumb divider
变量移动到第一个line@JohnVelasquez-你想让我从哪里删除?这个@import“~bootstrap/scss/bootstrap”怎么样
我已经在应用程序中导入了style.scss
仅对吗?你可以按照你的建议删除和添加它,不走运!!你能告诉我你试过什么吗。。。。另外,在更新angular.json文件后重新运行ng serve命令。breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:;}