Skip to content

Commit

Permalink
Docs - switch to using bootstrap from npm
Browse files Browse the repository at this point in the history
  • Loading branch information
ethancrawford committed Sep 9, 2021
1 parent eee5418 commit 9a22e06
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 4 deletions.
2 changes: 1 addition & 1 deletion etc/docs/assets/css/app.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This file is for your main application css. */

@import "../node_modules/bootstrap/scss/bootstrap";
/* LiveView specific classes for your customizations */
.phx-no-feedback.invalid-feedback,
.phx-no-feedback .invalid-feedback {
Expand Down
1 change: 1 addition & 0 deletions etc/docs/assets/js/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// We need to import the CSS so that webpack will load it.
// The MiniCssExtractPlugin is used to separate it out into
// its own CSS file.
import 'bootstrap';
import "../css/app.scss"

// webpack automatically bundles all modules in your
Expand Down
35 changes: 35 additions & 0 deletions etc/docs/assets/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion etc/docs/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"watch": "webpack --mode development --watch"
},
"dependencies": {
"bootstrap": "^5.1.1",
"phoenix": "file:../deps/phoenix",
"phoenix_html": "file:../deps/phoenix_html",
"phoenix_live_view": "file:../deps/phoenix_live_view",
Expand All @@ -20,8 +21,8 @@
"css-loader": "^3.4.2",
"hard-source-webpack-plugin": "^0.13.1",
"mini-css-extract-plugin": "^0.9.0",
"sass": "^1.37.5",
"optimize-css-assets-webpack-plugin": "^5.0.1",
"sass": "^1.37.5",
"sass-loader": "^8.0.2",
"terser-webpack-plugin": "^2.3.2",
"webpack": "^4.41.5",
Expand Down
2 changes: 0 additions & 2 deletions etc/docs/lib/docs_web/templates/layout/root.html.leex
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
<%= csrf_meta_tag() %>
<%= live_title_tag assigns[:page_title] || "Docs", suffix: " · Phoenix Framework" %>
<link phx-track-static rel="stylesheet" href="<%= Routes.static_path(@conn, "/css/app.css") %>"/>
<link phx-track-static rel="stylesheet" href="<%= Routes.static_path(@conn, "/css/bootstrap.min.css") %>"/>
<script defer phx-track-static type="text/javascript" src="<%= Routes.static_path(@conn, "/js/app.js") %>"></script>
</head>
<body>
<%= @inner_content %>
<script defer phx-track-static type="text/javascript" src="<%= Routes.static_path(@conn, "/js/bootstrap.bundle.min.js") %>"></script>
</body>
</html>

0 comments on commit 9a22e06

Please sign in to comment.