Skip to content

Commit 23a2f11

Browse files
committed
Sage 10 theme now configured with tailwindcss and vuejs
1 parent 7f4d10f commit 23a2f11

24 files changed

+363
-252
lines changed

package.json

+7-3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,13 @@
4040
"vue-template-compiler": "^2.6"
4141
},
4242
"dependencies": {
43-
"bootstrap": "^4.3",
4443
"jquery": "^3.4",
45-
"js-dom-router": "^1.0",
46-
"popper.js": "^1.15"
44+
"laravel-mix-purgecss": "^4.1.0",
45+
"laravel-mix-tailwind": "^0.1.0",
46+
"popper.js": "^1.15",
47+
"postcss-import": "^12.0.1",
48+
"postcss-nesting": "^7.0.1",
49+
"tailwindcss": "^1.1.2",
50+
"vue": "^2.5.17"
4751
}
4852
}

resources/assets/scripts/app.js

+22-20
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,32 @@
11
/**
2-
* External Dependencies
2+
* First we will load all of this project's JavaScript dependencies which
3+
* includes Vue and other libraries. It is a great starting point when
4+
* building robust, powerful web applications using Vue and Laravel.
35
*/
4-
import 'jquery';
5-
import 'bootstrap';
6-
import { router } from 'js-dom-router';
76

8-
/**
9-
* DOM-based routing
10-
*/
11-
import about from './routes/about';
7+
require('./bootstrap');
8+
9+
window.Vue = require('vue');
1210

1311
/**
14-
* Below is an example of a dynamic import; it will not be loaded until it's needed.
12+
* The following block of code may be used to automatically register your
13+
* Vue components. It will recursively scan this directory for the Vue
14+
* components and automatically register them with their "basename".
1515
*
16-
* See: {@link https://webpack.js.org/guides/code-splitting/#dynamic-imports | Dynamic Imports}
16+
* Eg. ./components/ExampleComponent.vue -> <example-component></example-component>
1717
*/
18-
const home = async () => import(/* webpackChunkName: "scripts/routes/home" */ './routes/home');
18+
19+
// const files = require.context('./', true, /\.vue$/i);
20+
// files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default));
21+
22+
// Vue.component('example-component', require('./components/ExampleComponent.vue').default);
1923

2024
/**
21-
* Set up DOM router
22-
*
23-
* .on(<name of body class>, callback)
24-
*
25-
* See: {@link http://goo.gl/EUTi53 | Markup-based Unobtrusive Comprehensive DOM-ready Execution} by Paul Irish
25+
* Next, we will create a fresh Vue application instance and attach it to
26+
* the page. Then, you may begin adding components to this application
27+
* or customize the JavaScript scaffolding to fit your unique needs.
2628
*/
27-
router
28-
.on('about-us', about)
29-
.on('home', async (event) => (await home()).default(event))
30-
.ready();
29+
30+
const app = new Vue({
31+
el: '#app',
32+
});

resources/assets/scripts/bootstrap.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
window._ = require('lodash');
2+
3+
/**
4+
* We'll load the axios HTTP library which allows us to easily issue requests
5+
* to our Laravel back-end. This library automatically handles sending the
6+
* CSRF token as a header based on the value of the "XSRF" token cookie.
7+
*/
8+
9+
window.axios = require('axios');
10+
11+
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<template>
2+
<div class="container">
3+
<div class="row justify-content-center">
4+
<div class="col-md-8">
5+
<div class="card">
6+
<div class="card-header">Example Component</div>
7+
8+
<div class="card-body">
9+
I'm an example component.
10+
</div>
11+
</div>
12+
</div>
13+
</div>
14+
</div>
15+
</template>
16+
17+
<script>
18+
export default {
19+
mounted() {
20+
console.log('Component mounted.')
21+
}
22+
}
23+
</script>

resources/assets/scripts/routes/about.js

-6
This file was deleted.

resources/assets/scripts/routes/home.js

-6
This file was deleted.

resources/assets/styles/app.scss

+59-17
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,62 @@
1-
/** Config */
2-
@import 'config/functions';
3-
@import 'config/variables';
4-
@import 'config/external';
1+
/**
2+
* This injects Tailwind's base styles, which is a combination of
3+
* Normalize.css and some additional base styles.
4+
*
5+
* You can see the styles here:
6+
* https://github.com/tailwindcss/tailwindcss/blob/master/css/preflight.css
7+
*
8+
* If using `postcss-import`, use this import instead:
9+
*
10+
* @import "tailwindcss/preflight";
11+
*/
12+
@tailwind base;
513

6-
/** Common */
7-
@import 'common/global';
14+
/**
15+
* This injects any component classes registered by plugins.
16+
*
17+
* If using `postcss-import`, use this import instead:
18+
*
19+
* @import "tailwindcss/components";
20+
*/
21+
@tailwind components;
822

9-
/** Components */
10-
@import 'components/buttons';
11-
@import 'components/comments';
12-
@import 'components/forms';
13-
@import 'components/wp-classes';
23+
/**
24+
* Here you would add any of your custom component classes; stuff that you'd
25+
* want loaded *before* the utilities so that the utilities could still
26+
* override them.
27+
*
28+
* Example:
29+
*
30+
* .btn { ... }
31+
* .form-input { ... }
32+
*
33+
* Or if using a preprocessor or `postcss-import`:
34+
*
35+
* @import "components/buttons";
36+
* @import "components/forms";
37+
*/
1438

15-
/** Layouts */
16-
@import 'layouts/header';
17-
@import 'layouts/footer';
18-
@import 'layouts/pages';
19-
@import 'layouts/posts';
20-
@import 'layouts/tinymce';
39+
/**
40+
* This injects all of Tailwind's utility classes, generated based on your
41+
* config file.
42+
*
43+
* If using `postcss-import`, use this import instead:
44+
*
45+
* @import "tailwindcss/utilities";
46+
*/
47+
@tailwind utilities;
48+
49+
/**
50+
* Here you would add any custom utilities you need that don't come out of the
51+
* box with Tailwind.
52+
*
53+
* Example :
54+
*
55+
* .bg-pattern-graph-paper { ... }
56+
* .skew-45 { ... }
57+
*
58+
* Or if using a preprocessor or `postcss-import`:
59+
*
60+
* @import "utilities/background-patterns";
61+
* @import "utilities/skew-transforms";
62+
*/

resources/assets/styles/common/global.scss

-3
This file was deleted.

resources/assets/styles/components/buttons.scss

-3
This file was deleted.

resources/assets/styles/components/comments.scss

-27
This file was deleted.

resources/assets/styles/components/forms.scss

-22
This file was deleted.

resources/assets/styles/components/wp-classes.scss

-56
This file was deleted.

resources/assets/styles/config/external.scss

-5
This file was deleted.

resources/assets/styles/config/functions.scss

-5
This file was deleted.

resources/assets/styles/config/variables.scss

-11
This file was deleted.

resources/assets/styles/layouts/footer.scss

-7
This file was deleted.

resources/assets/styles/layouts/header.scss

-13
This file was deleted.

resources/assets/styles/layouts/pages.scss

-7
This file was deleted.

resources/assets/styles/layouts/posts.scss

-7
This file was deleted.

resources/assets/styles/layouts/tinymce.scss

-7
This file was deleted.

resources/views/layouts/app.blade.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
@php(do_action('get_header'))
88
@include('partials.header')
99

10-
<div class="wrap container">
10+
<div id="app">
1111
<div class="content">
1212
<main class="main">
1313
@yield('content')

0 commit comments

Comments
 (0)