Skip to content

Commit

Permalink
Merge pull request #9 from dniccum/feature/responsive-layout
Browse files Browse the repository at this point in the history
Feature/responsive layout
  • Loading branch information
dniccum authored Oct 24, 2019
2 parents c6748e4 + dc77df5 commit 636ef23
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 14 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ phpunit.xml
.phpunit.result.cache
.DS_Store
Thumbs.db
yarn.lock
yarn.lock
/dist/js/tool.js.map
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ This is a tool for Laravel's Nova administrator panel that allows you to create
* Allows for nested directories
* Syntax highlighting for code blocks (via [highlight.js](https://highlightjs.org/))
* Replaces local links within the body content to work within the Nova environment.
* Supports [Laravel Nova Responsive Theme](https://novapackages.com/packages/gregoriohc/laravel-nova-theme-responsive)

## Installation

Expand Down
2 changes: 1 addition & 1 deletion dist/css/tool.css

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

2 changes: 1 addition & 1 deletion dist/js/tool.js

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@
},
"devDependencies": {
"cross-env": "^5.0.0",
"laravel-mix": "^1.0"
"laravel-mix": "^4.0",
"laravel-mix-purgecss": "^4.2.0",
"sass": "^1.23.1",
"sass-loader": "^7.3.1",
"vue-template-compiler": "^2.6.10"
},
"dependencies": {
"highlight.js": "^9.14.2",
"tailwindcss": "^1.1.3",
"vue": "^2.5.0"
}
}
9 changes: 3 additions & 6 deletions resources/js/components/Page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<div>
<heading class="mb-6">{{ title }}</heading>

<div class="flex flex-row">
<card class="w-4/5 bg-white p-6 mr-2" style="min-height: 300px">
<div class="flex doc-flex-col md:doc-flex-row">
<card class="doc-order-3 md:doc-order-first doc-w-full md:doc-w-3/5 lg:doc-w-2/3 xl:doc-w-8/12 bg-white p-6 md:doc-mr-3" style="min-height: 300px">
<div class="documentation-content" v-html="content"></div>
</card>
<sidebar :content="sidebar"></sidebar>
Expand Down Expand Up @@ -39,10 +39,7 @@
}, 500)
},
methods: {
// content() {
// // return Vue.compile(this.content);
// return this.content
// }
//
}
}
</script>
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/Sidebar.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<card class="w-1/5 bg-white p-6 self-start" style="min-height: 300px">
<card class="doc-order-first md:doc-order-3 doc-w-full md:doc-w-2/5 lg:doc-w-4/12 xl:doc-w-4/12 bg-white p-6 self-start mb-3 md:doc-mb-0">
<h3 class="mb-2">Contents</h3>
<ul>
<li class="mb-2" v-for="item of content">
Expand Down
4 changes: 3 additions & 1 deletion resources/js/tool.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Page from './components/Page';

const routes = [{
path: '/documentation/home',
redirect: '/documentation'
Expand All @@ -8,7 +10,7 @@ Nova.config.pages.map((page) => {
let route = {
name: `documentation/${page.pageRoute}`,
path: `/documentation/${page.pageRoute}`,
component: require('./components/Page'),
component: Page,
props: {
file: page.file,
title: page.title,
Expand Down
22 changes: 22 additions & 0 deletions resources/sass/tool.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,26 @@
// Nova Tool CSS
@tailwind base;
@tailwind components;
@tailwind utilities;

@responsive {
.doc-w-2\/5 {
width: 40%;
}
.doc-w-3\/5 {
width: 60%;
}
.doc-w-4\/5 {
width: 80%;
}
.doc-mr-2 {
margin-right: 0.5rem;
}
.doc-mr-3 {
margin-right: 0.75rem;
}
}

.documentation-content {

p,
Expand Down
13 changes: 13 additions & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// tailwind.config.js
module.exports = {
theme: {},
variants: {},
plugins: [],
corePlugins: [
'width',
'order',
'flexDirection',
'margin',
],
prefix: 'doc-',
};
15 changes: 13 additions & 2 deletions webpack.mix.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
let mix = require('laravel-mix')
const tailwindcss = require('tailwindcss')
require('laravel-mix-purgecss');

mix.setPublicPath('dist')
.js('resources/js/tool.js', 'js')
.sass('resources/sass/tool.scss', 'css')
.js('resources/js/tool.js', 'js')
.sass('resources/sass/tool.scss', 'css')
.options({
processCssUrls: false,
postCss: [ tailwindcss('./tailwind.config.js'), ],
})
.purgeCss();

if (!mix.inProduction()) {
mix.sourceMaps();
}

0 comments on commit 636ef23

Please sign in to comment.