Skip to content

Commit

Permalink
add gin subtheme... even though it doesnt work yet
Browse files Browse the repository at this point in the history
  • Loading branch information
jonpugh committed Sep 4, 2024
1 parent 1eb80a9 commit e49e224
Show file tree
Hide file tree
Showing 28 changed files with 330 additions and 25 deletions.
145 changes: 144 additions & 1 deletion composer.lock

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

24 changes: 0 additions & 24 deletions config/sync/.htaccess

This file was deleted.

13 changes: 13 additions & 0 deletions src/Drupal/Themes/devshop_gin/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "drupal/devshop_gin",
"description": "DevShop theme, based on Gin.",
"type": "drupal-theme",
"authors": [
{
"name": "Jon Pugh",
"email": "[email protected]"
}
],
"minimum-stability": "dev",
"require": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Default settings of DevShop Gin theme.
example: 'foo'
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Schema for the configuration files of the DevShop Gin theme.
devshop_gin.settings:
type: theme_settings
label: 'DevShop Gin settings'
mapping:
example:
type: string
label: Example
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
30 changes: 30 additions & 0 deletions src/Drupal/Themes/devshop_gin/devshop_gin.breakpoints.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
devshop_gin.extra_small:
label: mobile
mediaQuery: ''
weight: 0
multipliers:
- 1x
devshop_gin.small:
label: mobile
mediaQuery: 'all and (min-width: 576px) and (max-width: 767px)'
weight: 1
multipliers:
- 1x
devshop_gin.medium:
label: narrow
mediaQuery: 'all and (min-width: 768px) and (max-width: 991px)'
weight: 2
multipliers:
- 1x
devshop_gin.large:
label: wide
mediaQuery: 'all and (min-width: 992px) and (max-width: 1199px)'
weight: 3
multipliers:
- 1x
devshop_gin.extra_large:
label: wide
mediaQuery: 'all and (min-width: 1200px)'
weight: 4
multipliers:
- 1x
20 changes: 20 additions & 0 deletions src/Drupal/Themes/devshop_gin/devshop_gin.info.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: DevShop Gin
type: theme
base theme: gin
description: DevShop Front-end
package: DevShop
core_version_requirement: ^10
libraries:
- devshop_gin/global
regions:
header: 'Header'
primary_menu: 'Primary menu'
secondary_menu: 'Secondary menu'
page_top: 'Page top'
page_bottom: 'Page bottom'
featured: 'Featured'
breadcrumb: 'Breadcrumb'
content: 'Content'
sidebar_first: 'Sidebar first'
sidebar_second: 'Sidebar second'
footer: 'Footer'
24 changes: 24 additions & 0 deletions src/Drupal/Themes/devshop_gin/devshop_gin.libraries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Main theme library.
global:
js:
js/devshop-gin.js: {}
css:
base:
css/base/elements.css: {}
component:
css/component/block.css: {}
css/component/breadcrumb.css: {}
css/component/field.css: {}
css/component/form.css: {}
css/component/header.css: {}
css/component/menu.css: {}
css/component/messages.css: {}
css/component/node.css: {}
css/component/sidebar.css: {}
css/component/table.css: {}
css/component/tabs.css: {}
css/component/buttons.css: {}
layout:
css/layout/layout.css: {}
theme:
css/theme/print.css: { media: print }
29 changes: 29 additions & 0 deletions src/Drupal/Themes/devshop_gin/devshop_gin.theme
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

declare(strict_types=1);

/**
* @file
* Functions to support theming in the DevShop Gin theme.
*/

/**
* Implements hook_preprocess_HOOK() for html.html.twig.
*/
function devshop_gin_preprocess_html(array &$variables): void {

}

/**
* Implements hook_preprocess_HOOK() for page.html.twig.
*/
function devshop_gin_preprocess_page(array &$variables): void {

}

/**
* Implements hook_preprocess_HOOK() for node.html.twig.
*/
function devshop_gin_preprocess_node(array &$variables): void {

}
17 changes: 17 additions & 0 deletions src/Drupal/Themes/devshop_gin/js/devshop-gin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* @file
* DevShop Gin behaviors.
*/
(function (Drupal) {

'use strict';

Drupal.behaviors.devshopGin = {
attach (context, settings) {

console.log('It works!');

}
};

} (Drupal));
4 changes: 4 additions & 0 deletions src/Drupal/Themes/devshop_gin/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions src/Drupal/Themes/devshop_gin/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "devshop_gin",
"private": true,
"scripts": {
"livereload": "livereload --exclusions node_modules/ --exts 'css,js,twig,theme,apng,avif,gif,jpg,jpeg,jfif,pjpeg,pjp,png,svg,webp'"
},
"devDependencies": {
"livereload": "^0.9.3"
}
}
29 changes: 29 additions & 0 deletions src/Drupal/Themes/devshop_gin/theme-settings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

declare(strict_types=1);

/**
* @file
* Theme settings form for DevShop Gin theme.
*/

use Drupal\Core\Form\FormState;

/**
* Implements hook_form_system_theme_settings_alter().
*/
function devshop_gin_form_system_theme_settings_alter(array &$form, FormState $form_state): void {

$form['devshop_gin'] = [
'#type' => 'details',
'#title' => t('DevShop Gin'),
'#open' => TRUE,
];

$form['devshop_gin']['example'] = [
'#type' => 'textfield',
'#title' => t('Example'),
'#default_value' => theme_get_setting('example'),
];

}

0 comments on commit e49e224

Please sign in to comment.