Jam*_*tti 2 bootstrap-4 angular angular6
我多年来一直是后端开发人员,但我对前端非常陌生。在过去的几周里,我一直在为一个工作项目学习 Angular 6 和 Bootstrap 4。
我有一个基本的 Angular 6 应用程序设置,并且我成功地使用了 Bootstrap 4,默认主题/样式。为了得到我目前的位置,我做了以下事情:
ng new project-name --style=scss –routing,所以我有一个src/styles.scss文件@import "~bootstrap/scss/bootstrap"; // Bootstrap 4 and it's defaults
"styles": [
"src/styles.scss"
],
"scripts": [
"node_modules/jquery/dist/jquery.min.js",
"node_modules/popper.js/dist/umd/popper.min.js",
"node_modules/bootstrap/dist/js/bootstrap.min.js"
]
已决定使用Maisonnette 主题为应用程序提供更“企业化”的外观。我们已经购买了主题,我已经下载并扩展了 .zip 文件……现在我迷路了。我不知道:
感觉这应该非常简单,并且应该可以在 Google、YouTube 和/或 StackOverflow 上找到大量示例。但是,我没有找到任何运气。一切似乎都是关于用一些变量来调整默认主题;不是批发更换。
任何帮助将不胜感激。
谢谢。
After some trial-and-error, and re-reading the docs several times, I came up with something that appears to be working for a minimal installation/usage for the Mainsonnette theme. I won't guarantee it is the correct way to do it though.
I had assumed themes would be pretty standard, and there would be a single set of steps required to incorporate any theme, but apparently I was mistaken. I now believe the first several steps below outline what will be necessary for any theme; however, the contents of what needs to be specified in each file will vary by theme. The final step is likely optional, depending on the theme.
Good luck.
I updated src/styles.scss to look like this:
// The Maisonnette theme dependencies
@import "assets/lib/stroke-7/style.css";
@import "assets/lib/perfect-scrollbar/css/perfect-scrollbar.min.css";
// The Maisonnette theme itself (includes BS4 CSS)
@import "assets/css/app.min.css";
Run Code Online (Sandbox Code Playgroud)In angular.json, I updated projects...architect.build.options.scripts to look like this:
"scripts": [
"src/assets/maisonette/lib/jquery/jquery.min.js",
"src/assets/maisonette/lib/perfect-scrollbar/js/perfect-scrollbar.min.js",
"src/assets/maisonette/lib/bootstrap/dist/js/bootstrap.bundle.min.js",
"src/assets/maisonette/js/app.min.js"
]
Run Code Online (Sandbox Code Playgroud)In index.html, I placed the following JavaScript at the bottom of the body tag:
<!-- Initialize Maisonnette theme -->
<script type="text/javascript">
$(document).ready(function(){
//initialize the javascript
App.init();
});
</script>
Run Code Online (Sandbox Code Playgroud)| 归档时间: |
|
| 查看次数: |
1805 次 |
| 最近记录: |