Skip to content

Commit

Permalink
Merge pull request #12964 from rtibbles/017intodevelop
Browse files Browse the repository at this point in the history
0.17 into develop
  • Loading branch information
rtibbles authored Dec 19, 2024
2 parents 018ae11 + a780aa6 commit 49555de
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 12 deletions.
16 changes: 11 additions & 5 deletions packages/kolibri/components/pages/AppBarPage/internal/AppBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,23 @@

<div
v-show="!$isPrint"
:style="{ backgroundColor: $themeTokens.appBar }"
:style="{
backgroundColor: themeConfig.appBar.background,
color: themeConfig.appBar.textColor,
}"
>
<header>
<SkipNavigationLink />

<KToolbar
:removeNavIcon="showAppNavView"
type="clear"
textColor="black"
:textColor="themeConfig.appBar.textColor"
class="app-bar"
:style="{ height: topBarHeight + 'px' }"
:style="{
height: topBarHeight + 'px',
color: themeConfig.appBar.textColor,
}"
:raised="false"
:removeBrandDivider="true"
>
Expand All @@ -26,7 +32,7 @@
>
<KIconButton
icon="menu"
:color="$themeTokens.text"
:color="themeConfig.appBar.textColor"
:ariaLabel="$tr('openNav')"
@click="$emit('toggleSideNav')"
/>
Expand Down Expand Up @@ -94,7 +100,7 @@
<KIcon
icon="person"
:style="{
fill: $themeTokens.text,
fill: themeConfig.appBar.textColor,
height: '24px',
width: '24px',
margin: '4px',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import { validateLinkObject } from 'kolibri/utils/validators';
import useKResponsiveWindow from 'kolibri-design-system/lib/composables/useKResponsiveWindow';
import themeConfig from 'kolibri/styles/themeConfig';
/**
Links for use inside the Navbar
Expand All @@ -38,6 +39,7 @@ Links for use inside the Navbar
setup() {
const { windowIsSmall } = useKResponsiveWindow();
return {
themeConfig,
windowIsSmall,
};
},
Expand All @@ -61,7 +63,7 @@ Links for use inside the Navbar
computed: {
tabStyles() {
return {
color: this.$themeTokens.text,
color: this.themeConfig.appBar.textColor,
':hover': {
'background-color': this.$themeBrand.secondary.v_600,
},
Expand All @@ -81,7 +83,7 @@ Links for use inside the Navbar
activeClasses() {
// return both fixed and dynamic classes
return `router-link-active ${this.$computedClass({
color: this.$themeTokens.text,
color: this.themeConfig.appBar.textColor,
})}`;
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
>
<KIcon
:icon="link.icon"
:color="$themeTokens.text"
:color="themeConfig.appBar.textColor"
/>
</NavbarLink>
</ul>
Expand All @@ -27,7 +27,7 @@
:ariaLabel="coreString('moreOptions')"
icon="optionsHorizontal"
appearance="flat-button"
:color="$themeTokens.text"
:color="themeConfig.appBar.textColor"
:primary="false"
class="kiconbutton-style"
>
Expand All @@ -51,6 +51,7 @@
import isUndefined from 'lodash/isUndefined';
import commonCoreStrings from 'kolibri/uiText/commonCoreStrings';
import useKResponsiveWindow from 'kolibri-design-system/lib/composables/useKResponsiveWindow';
import themeConfig from 'kolibri/styles/themeConfig';
import NavbarLink from './NavbarLink';
/**
* Used for navigation between sub-pages of a top-level Kolibri section
Expand All @@ -67,6 +68,7 @@
windowIsLarge,
windowIsMedium,
windowWidth,
themeConfig,
};
},
props: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,22 +196,23 @@
height: topBarHeight + 'px',
width: `${width}`,
paddingTop: windowIsSmall ? '4px' : '8px',
backgroundColor: $themeTokens.appBar,
backgroundColor: themeConfig.appBar.background,
color: themeConfig.appBar.textColor,
}"
>
<KIconButton
ref="closeButton"
tabindex="0"
icon="close"
:color="$themeTokens.text"
:color="themeConfig.appBar.textColor"
class="side-nav-header-icon"
:ariaLabel="$tr('closeNav')"
size="large"
@click="toggleNav"
/>
<span
class="side-nav-header-name"
:style="{ color: $themeTokens.text }"
:style="{ color: themeConfig.appBar.textColor }"
>{{ sideNavTitleText }}</span>
</div>
</KFocusTrap>
Expand Down
20 changes: 20 additions & 0 deletions packages/kolibri/styles/internal/themeSpec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logger from 'kolibri-logging';
import { themeTokens } from 'kolibri-design-system/lib/styles/theme';
import isObject from 'lodash/isObject';

const logging = logger.getLogger(__filename);
Expand Down Expand Up @@ -42,6 +43,25 @@ const _imageSpec = {
};

export default {
appBar: {
type: Object,
default: null,
spec: {
background: {
type: String,
default: themeTokens().appBar,
},
textColor: {
type: String,
default: themeTokens().text,
},
topLogo: {
type: Object,
default: null,
spec: _imageSpec,
},
},
},
brandColors: {
type: Object,
default: null,
Expand Down
2 changes: 2 additions & 0 deletions packages/kolibri/styles/themeConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import Vue from 'vue';

const themeConfig = Vue.observable({
appBar: {
background: null,
textColor: null,
topLogo: {
src: null,
alt: null,
Expand Down

0 comments on commit 49555de

Please sign in to comment.