Skip to content

Commit d3c7588

Browse files
committed
New year changes
1 parent e50d836 commit d3c7588

9 files changed

Lines changed: 104 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## WIP
44
- Add support for Google fonts
5+
- Add text colour utility classes
6+
- Add support for button groups
7+
- Add small button utility
8+
- Add ability to hide component on homepage
59
- Move to Web Asset Manager for assets
610

711
## 1.1.2

index.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@
1515
/** @var Joomla\CMS\Document\HtmlDocument $this */
1616

1717
$app = Factory::getApplication();
18+
$menuObj = $app->getMenu();
1819
$wa = $this->getWebAssetManager();
1920
$sitename = htmlspecialchars($app->get('sitename'), ENT_QUOTES, 'UTF-8');
20-
$pageclass = $app->getMenu()->getActive()->getParams()->get('pageclass_sfx');
21+
$pageclass = $menuObj->getActive()->getParams()->get('pageclass_sfx');
2122
$themeSwitcher = (boolean)$this->params->get('theme-switcher', 1);
23+
$hideComponent = (boolean)$this->params->get('hide-component', 1);
2224
$fontAwesome = (boolean)$this->params->get('font-awesome-thats-actually-rather-shit', 1);
2325
$googleFont = $this->params->get('google-font', '');
2426

@@ -113,6 +115,11 @@
113115
$footer = $this->getBuffer('modules', 'footer', $attribs = ['style' => 'none']);
114116
$debug = $this->getBuffer('modules', 'debug', $attribs = ['style' => 'none']);
115117

118+
// If we're on the homepage and `hideComponent` is true, set the buffer as an empty string
119+
if ($menuObj->getActive() == $menuObj->getDefault() && $hideComponent)
120+
{
121+
$component = '';
122+
}
116123
?>
117124
<!DOCTYPE html>
118125
<html lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">

language/en-GB/en-GB.tpl_lightning.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ TPL_LIGHTNING_GOOGLE_FONTS="Google Fonts"
1818
TPL_LIGHTNING_GOOGLE_FONTS_API_KEY="Google Fonts API Key"
1919
TPL_LIGHTNING_GOOGLE_FONTS_API_KEY_DESC="Entering Google Fonts API key will be used to populate the fonts list below"
2020

21+
TPL_LIGHTNING_HIDE_COMPONENT="Hide component on homepage"
22+
TPL_LIGHTNING_HIDE_COMPONENT_DESC="Preventing a component from being rendered on the homepage is useful when you only wish to display modules"
23+
2124
TPL_LIGHTNING_LOAD_FONT_AWESOME="Load Font Awesome"
2225

2326
TPL_LIGHTNING_LOGO_LABEL="Site logo file"

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/* Button Group */
2+
3+
.btn-group {
4+
position: relative;
5+
display: inline-flex;
6+
vertical-align: middle;
7+
8+
> button {
9+
position: relative;
10+
flex: 1 1 auto;
11+
}
12+
13+
> button:hover,
14+
> button:focus,
15+
> button:active,
16+
> button.active {
17+
z-index: 1;
18+
}
19+
}
20+
21+
.btn-toolbar {
22+
display: flex;
23+
flex-wrap: wrap;
24+
justify-content: flex-start;
25+
26+
.input-group {
27+
width: auto;
28+
}
29+
}
30+
31+
.btn-group {
32+
border-radius: var(--hiq-button-border-radius);
33+
34+
> button:not(:first-child),
35+
> .btn-group:not(:first-child) {
36+
margin-left: -var(--hiq-button-border-width);
37+
}
38+
39+
> button:not(:last-child):not(.dropdown-toggle),
40+
> .btn-group:not(:last-child) > button {
41+
border-top-right-radius: 0;
42+
border-bottom-right-radius: 0;
43+
}
44+
45+
> button:nth-child(n + 3),
46+
> :not(.btn-check) + button,
47+
> .btn-group:not(:first-child) > button {
48+
border-top-left-radius: 0;
49+
border-bottom-left-radius: 0;
50+
}
51+
}

src/css/elements/buttons.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,9 @@ apply mixin to:
8686
fieldset[disabled] [role='button'] {
8787
pointer-events: none;
8888
}
89+
90+
/* Small button */
91+
.btn-sm {
92+
padding: var(--hiq-button-small-vertical-padding) var(--hiq-button-small-horizontal-padding);
93+
font-size: var(--hiq-font-size-small);
94+
}

src/css/utility/text.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/* Text */
2+
3+
.text-warning {
4+
color: var(--hiq-color-warning);
5+
}
6+
7+
.text-danger {
8+
color: var(--hiq-color-danger);
9+
}
10+
11+
.text-success {
12+
color: var(--hiq-color-success);
13+
}
14+
15+
.text-primary {
16+
color: var(--hiq-color-primary);
17+
}

src/css/variables.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@
131131
/* button variables */
132132
--hiq-button-vertical-padding: .4rem;
133133
--hiq-button-horizontal-padding: .75rem;
134+
--hiq-button-small-vertical-padding: .25rem;
135+
--hiq-button-small-horizontal-padding: .4rem;
134136
--hiq-button-border-width: 1px;
135137
--hiq-button-border-radius: var(--hiq-border-radius);
136138
--hiq-button-font-weight: var(--hiq-font-weight-medium);

templateDetails.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,18 @@
7373
<option value="1">JYES</option>
7474
</field>
7575

76+
<field
77+
name="hide-component"
78+
type="radio"
79+
layout="joomla.form.field.radio.switcher"
80+
default="0"
81+
label="TPL_LIGHTNING_HIDE_COMPONENT"
82+
description="TPL_LIGHTNING_HIDE_COMPONENT_DESC"
83+
>
84+
<option value="0">JNO</option>
85+
<option value="1">JYES</option>
86+
</field>
87+
7688
<field
7789
name="font-awesome-thats-actually-rather-shit"
7890
type="radio"

0 commit comments

Comments
 (0)