Skip to content

Commit

Permalink
Restructure twig templates, assets, and other config files
Browse files Browse the repository at this point in the history
  • Loading branch information
Levi Zitting committed Jun 17, 2019
1 parent 706dcfa commit b482afc
Show file tree
Hide file tree
Showing 54 changed files with 473 additions and 318 deletions.
24 changes: 9 additions & 15 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
module.exports = {
"extends": [
"airbnb-base",
"plugin:vue/recommended"
],
"airbnb-base"
],
"rules": {
"max-len": ["error", {
"code": 120,
}],
"import/prefer-default-export": ["never"],
"indent": ["error", 4],
"vue/html-indent": ["error", 4],
"vue/html-closing-bracket-newline": ["error", {
"singleline": "never",
"multiline": "always"
}],
"vue/max-attributes-per-line": [3, {
"singleline": 3,
"multiline": {
"max": 1,
"allowFirstLine": false
}
}]
"no-use-before-define": ["error", { "functions": false, "classes": true }],
"no-param-reassign": ["error", { "props": false }],
"consistent-return": ["off"],
"arrow-body-style": ["off"],
"class-methods-use-this": ["off"],
"func-names": ["off"],
"prefer-arrow-callback": ["off"],
},
"parserOptions": {
"parser": "babel-eslint",
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/.env
/.idea
/.vscode
/vendor
.DS_Store
/node_modules
Expand All @@ -9,4 +10,4 @@
!/web/web.config
/storage/**
!/storage/.gitkeep
/config/license.key
/config/license.key
Empty file added assets/img/.gitkeep
Empty file.
2 changes: 0 additions & 2 deletions assets/js/components/index.js

This file was deleted.

5 changes: 0 additions & 5 deletions assets/js/directives/index.js

This file was deleted.

5 changes: 0 additions & 5 deletions assets/js/directives/ref.js

This file was deleted.

24 changes: 0 additions & 24 deletions assets/js/main.js
Original file line number Diff line number Diff line change
@@ -1,24 +0,0 @@
import Vue from 'vue';

import { components } from './components';
import { directives } from './directives';

const $app = window.$app || {};

if ($app.devMode === 'true') {
Vue.config.devtools = true;
}

if ($app.devMode === 'false') {
Vue.config.devtools = false;
Vue.config.productionTip = false;
}

Vue.prototype.$global = $app;

window.$vue = new Vue({
el: '#root',
delimiters: ['[[', ']]'],
components,
directives,
});
2 changes: 0 additions & 2 deletions assets/scss/base/_all.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
@import "typography";
@import "fonts";
@import "icons";
@import "containers";
@import "buttons";
@import "global";
23 changes: 0 additions & 23 deletions assets/scss/base/buttons.scss

This file was deleted.

35 changes: 0 additions & 35 deletions assets/scss/base/containers.scss

This file was deleted.

12 changes: 7 additions & 5 deletions assets/scss/base/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ html {
font-size: 62.5%;
width: 100%;
height: 100%;
box-sizing: border-box;
}

body {
font-size: 1.6rem;
*,
*::before,
*::after {
box-sizing: inherit;
}


[v-cloak] {
display: none !important;
body {
font-size: 1.6rem;
}
1 change: 0 additions & 1 deletion assets/scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@

@import "utils/all";
@import "base/all";
@import "pages/all";
@import "modules/all";
4 changes: 3 additions & 1 deletion assets/scss/modules/_all.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@import "blocks/all";
@import "components/all";
@import "buttons";
@import "blocks";
@import "containers";
@import "navigation";
@import "footer";
Empty file added assets/scss/modules/blocks.scss
Empty file.
1 change: 0 additions & 1 deletion assets/scss/modules/blocks/_all.scss
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
@import "block";
3 changes: 0 additions & 3 deletions assets/scss/modules/blocks/block.scss

This file was deleted.

Empty file.
2 changes: 0 additions & 2 deletions assets/scss/modules/components/_all.scss

This file was deleted.

19 changes: 0 additions & 19 deletions assets/scss/modules/components/cropped-img.scss

This file was deleted.

16 changes: 0 additions & 16 deletions assets/scss/modules/components/image-overlay.scss

This file was deleted.

Empty file.
3 changes: 0 additions & 3 deletions assets/scss/modules/footer.scss
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
.module-footer {

}
3 changes: 0 additions & 3 deletions assets/scss/modules/navigation.scss
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
.module-navigation {

}
1 change: 0 additions & 1 deletion assets/scss/pages/_all.scss

This file was deleted.

3 changes: 0 additions & 3 deletions assets/scss/pages/page.scss

This file was deleted.

28 changes: 28 additions & 0 deletions assets/scss/utils/mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,31 @@
font-size: $max-size;
}
}

@mixin responsive-line-height($options) {
$min-size: map-get($options, min-size);
$max-size: map-get($options, max-size);
$lower-bound: map-get($options, lower-bound);
$upper-bound: map-get($options, upper-bound);

$max-minus-min: strip-unit($max-size) - strip-unit($min-size);

@if(index('rem', unit($min-size)) != null and index('rem', unit($max-size)) != null) {
$base-rem: 10;
$upper-minus-lower: strip-unit($upper-bound / $base-rem) - strip-unit($lower-bound / $base-rem);
$lower-bound-rems: #{strip-unit($lower-bound / $base-rem)}rem;

line-height: calc(#{$min-size} + #{$max-minus-min} * ((100vw - #{$lower-bound-rems}) / #{$upper-minus-lower}));
} @else {
$upper-minus-lower: strip-unit($upper-bound) - strip-unit($lower-bound);
line-height: calc(#{$min-size} + #{$max-minus-min} * ((100vw - #{$lower-bound}) / #{$upper-minus-lower}));
}

@include mq-below($lower-bound) {
line-height: $min-size;
}

@include mq-above($upper-bound) {
line-height: $max-size;
}
}
15 changes: 6 additions & 9 deletions assets/shared-vars.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,11 @@
"default": 0
},
"breakpoints": {
"x-tiny": 350,
"tiny": 400,
"x-small": 480,
"mid-small": 600,
"small": 768,
"medium": 960,
"large": 1224,
"x-large": 1440,
"xx-large": 1525
"phone-small": 340,
"phone-large": 600,
"tablet": 870,
"tablet-large": 1030,
"desktop-small": 1230,
"desktop-medium": 1270
}
}
Empty file added assets/web/.gitkeep
Empty file.
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"description": "Craft CMS",
"type": "project",
"require": {
"anubarak/craft-relabel": "^1.2",
"craftcms/aws-s3": "^1.1",
"craftcms/cms": "^3.0.0",
"craftcms/redactor": "^2.3",
Expand Down
1 change: 0 additions & 1 deletion composer.json.default
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"require": {
"anubarak/craft-relabel": "^1.2",
"craftcms/aws-s3": "^1.1",
"craftcms/cms": "^3.0.0",
"craftcms/redactor": "^2.3",
Expand Down
8 changes: 7 additions & 1 deletion config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
return [
'modules' => [
'my-module' => \modules\Module::class,
'twighelpers' => [
'class' => \modules\twighelpers\TwigHelpers::class,
],
],
//'bootstrap' => ['my-module'],
// 'bootstrap' => [
// 'my-module',
// 'twighelpers',
// ],
];
8 changes: 8 additions & 0 deletions config/general.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
* @see \craft\config\GeneralConfig
*/

use craft\helpers\ConfigHelper;

return [
// Global settings
'*' => [
Expand All @@ -26,12 +28,18 @@
// Whether to save the project config out to config/project.yaml
// (see https://docs.craftcms.com/v3/project-config.html)
'useProjectConfigFile' => true,

'pageTrigger' => '?page=',

'maxUploadFileSize' => ConfigHelper::sizeInBytes('128M'),
],

// Dev environment settings
'dev' => [
// Dev Mode (see https://craftcms.com/guides/what-dev-mode-does)
'devMode' => true,

'enableTemplateCaching' => false,
],

// Staging environment settings
Expand Down
4 changes: 2 additions & 2 deletions config/redactor/Simple.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"buttons": ["bold", "italic"],
"toolbarFixed": true
"buttons": ["bold", "italic", "link", "file"],
"toolbarFixed": true
}
4 changes: 2 additions & 2 deletions config/redactor/Standard.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"buttons": ["formatting", "bold", "italic", "unorderedlist", "orderedlist", "link", "image", "video"],
"plugins": ["fullscreen", "video"],
"buttons": ["formatting", "bold", "italic", "unorderedlist", "orderedlist", "link", "file", "image", "video"],
"plugins": ["alignment", "fullscreen", "video"],
"linkNewTab": true,
"toolbarFixed": true
}
7 changes: 7 additions & 0 deletions fortrabbit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2

# called before Composer runs
#pre:

# called after Composer runs
post: scripts/fortrabbit-post-install.php
Loading

0 comments on commit b482afc

Please sign in to comment.