Skip to content

Commit 0a26876

Browse files
committed
Tailwind starter theme
1 parent 89ab4c3 commit 0a26876

35 files changed

+2886
-0
lines changed

themes/stanford_profile_theme/dist/base.css

Lines changed: 1716 additions & 0 deletions
Large diffs are not rendered by default.
33.7 KB
Binary file not shown.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "stanford_profile_theme",
3+
"version": "1.0.0",
4+
"main": "index.js",
5+
"license": "MIT",
6+
"scripts": {
7+
"build": "npx tailwindcss -i ./src/base.scss -o ./dist/base.css"
8+
},
9+
"dependencies": {
10+
"@tailwindcss/forms": "^0.4.0-alpha.2",
11+
"decanter": "^7.0.0-beta.2",
12+
"tailwindcss": "^3.0.24",
13+
"tailwindcss-debug-screens": "^2.2.1"
14+
}
15+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: 'Stanford Profile Theme'
2+
type: theme
3+
description: 'Stanford Profile Theme.'
4+
package: Stanford
5+
version: 1.0.0
6+
core_version_requirement: ^9
7+
'base theme': stable9
8+
regions:
9+
page_top: 'Page top'
10+
header: Header
11+
search: Search
12+
menu: Menu
13+
help: Help
14+
content: Content
15+
footer: Footer
16+
page_bottom: 'Page bottom'
17+
features:
18+
- favicon
19+
- logo
20+
components:
21+
namespaces:
22+
stanford-profile-theme: templates
23+
libraries:
24+
- stanford_profile_theme/base
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
base:
2+
version: VERSION
3+
css:
4+
layout:
5+
dist/base.css: {}
6+
7+
fontawesome:
8+
version: 5.15.4
9+
remote: https://use.fontawesome.com/releases/v5.15.4/css/all.css
10+
license:
11+
name: FontAwesome
12+
url: http://fontawesome.io/license/
13+
css:
14+
base:
15+
//use.fontawesome.com/releases/v5.15.4/css/all.css: {}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
3+
/**
4+
* @file
5+
* Preprocess functions for Stanford Profile Theme.
6+
*/
7+
8+
/**
9+
* Implements hook_library_info_alter().
10+
*/
11+
function stanford_profile_theme_library_info_alter(&$libraries, $extension) {
12+
if (\Drupal::service('theme_handler')->themeExists($extension)) {
13+
return;
14+
}
15+
16+
$libraries = array_filter($libraries, function ($library) use ($extension) {
17+
return !preg_match('/(stanford_|jumpstart|react|ui_pattern)/', $extension);
18+
});
19+
}
20+
21+
/**
22+
* Implements hook_page_attachments_alter().
23+
*/
24+
function stanford_profile_theme_page_attachments_alter(array &$attachments) {
25+
$attachments['#attached']['drupalSettings']['data']['extlink']['extClass'] = 'su-hidden';
26+
}
27+
28+
/**
29+
* Implements hook_theme_suggestions_alter().
30+
*/
31+
function stanford_profile_theme_theme_suggestions_alter(array &$suggestions, array $variables, $hook) {
32+
33+
}
34+
35+
/**
36+
* Implements hook_preprocess_HOOK().
37+
*/
38+
function stanford_profile_theme_preprocess_block__system_branding_block(&$variables) {
39+
if(strpos($variables['site_logo'], 'stanford_profile_theme') !== false){
40+
global $base_path;
41+
$variables['site_logo'] = $base_path . \Drupal::service('extension.list.theme')
42+
->getPath('stanford_profile_theme') . '/logo.svg';
43+
}
44+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
content: ["templates/**/*.html.twig", "stanford_profile_theme.theme"],
3+
presets: [
4+
require('decanter/tailwind.config.js')
5+
],
6+
theme: {
7+
extend: {},
8+
},
9+
plugins: [],
10+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<a class="su-lockup su-no-underline su-inline-block" href="{{ url('<front>') }}">
2+
<div class="su-flex su-flex-col md:su-flex-row su-basefont-19">
3+
<div class="su-logo su-text-cardinal-red su-type-4 su-leading-half su-pt-11 su-pr-7 su-mr-7 md:su-border-r su-border-solid su-border-black">
4+
<img src="{{ site_logo }}" alt=""/>
5+
</div>
6+
<div class="su-text-25 md:su-text-m2 su--mt-3 md:su-mt-0 su--ml-2 md:su-ml-0 su-font-regular su-relative su-top-6 su-text-black">
7+
{{ site_name }}
8+
</div>
9+
</div>
10+
</a>
11+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<div data-drupal-messages>
2+
{% for type, messages in message_list %}
3+
<div role="contentinfo" aria-label="{{ status_headings[type] }}"{{ attributes|without('role', 'aria-label') }}>
4+
{% if type == 'error' %}
5+
<div role="alert">
6+
{% endif %}
7+
{% if status_headings[type] %}
8+
<h2 class="visually-hidden">{{ status_headings[type] }}</h2>
9+
{% endif %}
10+
{% if messages|length > 1 %}
11+
<ul>
12+
{% for message in messages %}
13+
<li>{{ message }}</li>
14+
{% endfor %}
15+
</ul>
16+
{% else %}
17+
{{ messages|first }}
18+
{% endif %}
19+
{% if type == 'error' %}
20+
</div>
21+
{% endif %}
22+
</div>
23+
{% endfor %}
24+
</div>

0 commit comments

Comments
 (0)