Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add theme switching and set fluent theme as default #901

Merged
merged 73 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from 51 commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
89dbfa0
Change theme to blue.light (#898)
dxvladislavvolkov Oct 22, 2024
c4c4fd6
Use fluent theme by default
dxvladislavvolkov Oct 23, 2024
8ec9500
Add tests for fluent
dxvladislavvolkov Oct 23, 2024
251ebee
Revert "Add tests for fluent"
dxvladislavvolkov Oct 23, 2024
a1e42f3
Revert "Use fluent theme by default"
dxvladislavvolkov Oct 23, 2024
ef871af
Vue:
GoodDayForSurf Nov 6, 2024
d031eb9
React:
GoodDayForSurf Nov 7, 2024
65044c0
Angular:
GoodDayForSurf Nov 7, 2024
b680130
changes for fix test
GoodDayForSurf Nov 8, 2024
0bd0be9
changes for fix test
GoodDayForSurf Nov 8, 2024
07da71c
changes for fix angular test
GoodDayForSurf Nov 8, 2024
6a725ff
changes for fix angular test
GoodDayForSurf Nov 8, 2024
0a6da3b
fix style after designer review
GoodDayForSurf Nov 11, 2024
4ca5cf9
remake user panel menu
GoodDayForSurf Nov 12, 2024
a3aacab
update etalons
GoodDayForSurf Nov 13, 2024
0de7583
fix formatting
GoodDayForSurf Nov 13, 2024
fc22eb4
update screenshots
GoodDayForSurf Nov 13, 2024
3970662
fix test
GoodDayForSurf Nov 13, 2024
dd41ba3
update screenshots
GoodDayForSurf Nov 14, 2024
a57da40
add fluent theme to testing
GoodDayForSurf Nov 14, 2024
5bfcdd8
add fluent screenshots
GoodDayForSurf Nov 14, 2024
81b9c81
update fluent screenshots
GoodDayForSurf Nov 14, 2024
491d32d
some changes for tests
GoodDayForSurf Nov 14, 2024
c28a968
some changes for tests
GoodDayForSurf Nov 14, 2024
96b39b3
fix ts in react
GoodDayForSurf Nov 14, 2024
b6a0cb3
update screenshots
GoodDayForSurf Nov 14, 2024
ac5fd09
fix react ts
GoodDayForSurf Nov 14, 2024
890d312
fix react ts
GoodDayForSurf Nov 14, 2024
730528d
fix react ts
GoodDayForSurf Nov 14, 2024
1e2f149
fix screenshots
GoodDayForSurf Nov 14, 2024
2da4ca3
fix header z-index in react
GoodDayForSurf Nov 14, 2024
61ed745
fix header z-index in react
GoodDayForSurf Nov 14, 2024
1aceb75
fix layout in react
GoodDayForSurf Nov 14, 2024
c561c30
fix z-index header in angular
GoodDayForSurf Nov 14, 2024
45e7ba6
fix style menu tree item in vue
GoodDayForSurf Nov 14, 2024
5e081cd
update screenshots
GoodDayForSurf Nov 14, 2024
292ab65
fix style menu tree item in react
GoodDayForSurf Nov 15, 2024
fe06be3
refactor header style in react
GoodDayForSurf Nov 15, 2024
e36df07
add test for dark mode
GoodDayForSurf Nov 15, 2024
23200be
add screenshot for dark mode
GoodDayForSurf Nov 15, 2024
055a1ce
fix test
GoodDayForSurf Nov 15, 2024
01a38eb
fix test
GoodDayForSurf Nov 15, 2024
b52505b
fix test
GoodDayForSurf Nov 15, 2024
76d0be7
remove back theme switching check
GoodDayForSurf Nov 15, 2024
34d1913
fix test
GoodDayForSurf Nov 15, 2024
930ee0b
add screenshots
GoodDayForSurf Nov 15, 2024
c2040ab
add screenshots
GoodDayForSurf Nov 15, 2024
d9e9bfa
add screenshots
GoodDayForSurf Nov 15, 2024
6f3fc5c
update screenshots
GoodDayForSurf Nov 15, 2024
3a4a651
update test
GoodDayForSurf Nov 15, 2024
c1f0e75
update screenshots
GoodDayForSurf Nov 15, 2024
9ca658b
clean code
GoodDayForSurf Nov 18, 2024
0c0e973
clean code
GoodDayForSurf Nov 18, 2024
f00f60e
clean code
GoodDayForSurf Nov 18, 2024
df6f5ca
clean code
GoodDayForSurf Nov 18, 2024
bd87f9e
clean code in angular home page styles
GoodDayForSurf Nov 18, 2024
64f2cf9
fix versions
GoodDayForSurf Nov 18, 2024
2f2e0a7
fix versions
GoodDayForSurf Nov 18, 2024
40ef898
fix versions
GoodDayForSurf Nov 18, 2024
2c01b36
fix angular version
GoodDayForSurf Nov 18, 2024
f1eb6ff
fix angular version
GoodDayForSurf Nov 18, 2024
b23ba29
fix angular version
GoodDayForSurf Nov 18, 2024
3b5e0c0
fix angular version
GoodDayForSurf Nov 18, 2024
9f593c0
fix angular version
GoodDayForSurf Nov 18, 2024
7afcf11
Revert "fix angular version"
GoodDayForSurf Nov 18, 2024
9b08de9
fix registry
GoodDayForSurf Nov 18, 2024
099a5c0
fix angular version
GoodDayForSurf Nov 18, 2024
4ddec62
fix angular version
GoodDayForSurf Nov 18, 2024
286c204
fix angular version
GoodDayForSurf Nov 18, 2024
b02b3e4
fix angular version
GoodDayForSurf Nov 18, 2024
d9c34f4
revert update versions
GoodDayForSurf Nov 18, 2024
91597e4
revert devextreme version
GoodDayForSurf Nov 18, 2024
d9397cf
fix review notes
GoodDayForSurf Nov 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/devextreme-cli/src/applications/application.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ const addTemplate = (appPath, appName, templateOptions) => {

const styles = [
'./themes/generated/theme.additional.css',
'./themes/generated/theme.additional.dark.css',
'./themes/generated/theme.base.css',
'./themes/generated/theme.base.dark.css',
'devextreme/dist/css/dx.common.css'
];

Expand Down
2 changes: 2 additions & 0 deletions packages/devextreme-cli/src/applications/application.vue.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ const addTemplate = (appPath, appName, templateOptions) => {
const applicationTemplatePath = path.join(templateCreator.getTempaltePath('vue-v3'), 'application');
const styles = [
'./themes/generated/theme.additional.css',
'./themes/generated/theme.additional.dark.css',
'./themes/generated/theme.base.css',
'./themes/generated/theme.base.dark.css',
'devextreme/dist/css/dx.common.css'
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,55 @@
"outputFile": "src/themes/generated/theme.base.css"
}
},
{
"command": "build-theme",
"options": {
"inputFile": "src/themes/metadata.base.dark.json",
"outputFile": "src/themes/generated/theme.base.dark.css"
}
},
{
"command": "build-theme",
"options": {
"inputFile": "src/themes/metadata.additional.json",
"outputFile": "src/themes/generated/theme.additional.css"
}
},
{
"command": "build-theme",
"options": {
"inputFile": "src/themes/metadata.additional.dark.json",
"outputFile": "src/themes/generated/theme.additional.dark.css"
}
},
{
"command": "export-theme-vars",
"options": {
"inputFile": "src/themes/metadata.base.json",
"outputFile": "src/themes/generated/variables.base.scss"
}
},
{
"command": "export-theme-vars",
"options": {
"inputFile": "src/themes/metadata.base.dark.json",
"outputFile": "src/themes/generated/variables.base.dark.scss"
}
},
{
"command": "export-theme-vars",
"options": {
"inputFile": "src/themes/metadata.additional.json",
"outputFile": "src/themes/generated/variables.additional.scss"
}
},
{
"command": "export-theme-vars",
"options": {
"inputFile": "src/themes/metadata.additional.dark.json",
"outputFile": "src/themes/generated/variables.additional.dark.scss"
}
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { AuthProvider, useAuth } from './contexts/auth';
import { useScreenSizeClass } from './utils/media-query';
import Content from './Content';
import UnauthenticatedContent from './UnauthenticatedContent';
import { ThemeContext, useThemeContext} from "./theme";

function App() {
const { user, loading } = useAuth();
Expand All @@ -24,16 +25,19 @@ function App() {

export default function Root() {
const screenSizeClass = useScreenSizeClass();
const themeContext = useThemeContext();

return (
<Router>
<AuthProvider>
<NavigationProvider>
<div className={`app ${screenSizeClass}`}>
<App />
</div>
</NavigationProvider>
</AuthProvider>
<ThemeContext.Provider value={themeContext}>
<AuthProvider>
<NavigationProvider>
<div className={`app ${screenSizeClass}`}>
<App />
</div>
</NavigationProvider>
</AuthProvider>
</ThemeContext.Provider>
</Router>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
.create-account-form {
.policy-info {
margin: 10px 0;
color: rgba($base-text-color, alpha($base-text-color) * 0.7);
color: var(--base-text-color-alpha-7);
font-size: 14px;
font-style: normal;

a {
color: rgba($base-text-color, alpha($base-text-color) * 0.7);
color: var(--base-text-color-alpha-7);
}
}

.login-link {
color: $base-accent;
color: var(--base-accent);
font-size: 16px;
text-align: center;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
@import "../../themes/generated/variables.base.scss";

.footer {
display: block;
color: rgba($base-text-color, alpha($base-text-color) * 0.7);
border-top: 1px solid rgba(0, 0, 0, 0.1);
color: var(--base-text-color-alpha-7);
border-top: 1px solid var(--footer-border-color);
padding-top: 20px;
padding-bottom: 24px;
margin: 0 40px;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
@import "../../themes/generated/variables.base.scss";
@import "../../dx-styles.scss";

header {
background-color: var(--base-bg);
}

.header-component {
flex: 0 0 auto;
z-index: 1;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);

.dx-toolbar .dx-toolbar-item.menu-button>.dx-toolbar-item-content .dx-icon {
color: $base-accent;
}
}

.dx-toolbar.header-toolbar .dx-toolbar-items-container .dx-toolbar-after {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Button from 'devextreme-react/button';
import UserPanel from '../user-panel/UserPanel';
import './Header.scss';
import { Template } from 'devextreme-react/core/template';
import { ThemeSwitcher } from '../theme-switcher/ThemeSwitcher';
<%=#isTypeScript%>import type { HeaderProps } from '../../types';<%=/isTypeScript%>

export default function Header({ menuToggleEnabled, title, toggleMenu }<%=#isTypeScript%>: HeaderProps<%=/isTypeScript%>) {
Expand All @@ -26,21 +27,16 @@ export default function Header({ menuToggleEnabled, title, toggleMenu }<%=#isTyp
/>
<Item
location={'after'}
locateInMenu={'auto'}
menuItemTemplate={'userPanelTemplate'}
>
<Button
className={'user-button authorization'}
width={210}
height={'100%'}
stylingMode={'text'}
>
<UserPanel menuMode={'context'} />
</Button>
<ThemeSwitcher />
</Item>
<Template name={'userPanelTemplate'}>
<UserPanel menuMode={'list'} />
<Item location='after' locateInMenu='auto' menuItemTemplate='userPanelTemplate'>
<UserPanel menuMode='context' />
</Item>
<Template name='userPanelTemplate'>
<UserPanel menuMode='list' />
</Template>

</Toolbar>
</header>
)}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@

.form-text {
margin: 10px 0;
color: rgba($base-text-color, alpha($base-text-color) * 0.7);
color: var(--base-text-color-alpha-7);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
}

.login-link {
color: $base-accent;
color: var(--base-accent);
font-size: 16px;
text-align: center;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,91 +1,72 @@
@import "../../dx-styles.scss";
@import "../../themes/generated/variables.additional.scss";

.side-navigation-menu {
display: flex;
flex-direction: column;
min-height: 100%;
height: 100%;
width: 250px !important;

.menu-container {
min-height: 100%;
.dx-swatch-additional, .dx-swatch-additional-dark {
&.side-navigation-menu {
display: flex;
flex: 1;
flex-direction: column;
min-height: 100%;
height: 100%;
width: 250px !important;
background-color: var(--base-bg);

.dx-treeview {
// ## Long text positioning
white-space: nowrap;
// ##
.menu-container {
min-height: 100%;
display: flex;
flex: 1;

// ## Icon width customization
.dx-treeview-item {
padding-left: 0;
flex-direction: row-reverse;
.dx-treeview {
// ## Long text positioning
white-space: nowrap;
// ##

.dx-icon {
width: $side-panel-min-width !important;
margin: 0 !important;
.dx-treeview-node-container:empty {
display: none;
}
}
// ##

// ## Arrow customization
.dx-treeview-node {
padding: 0 0 !important;
}

.dx-treeview-toggle-item-visibility {
right: 10px;
left: auto;
}
// ## Icon width customization
.dx-treeview-item {
padding-left: 0;
border-radius: 0;
flex-direction: row-reverse;

.dx-rtl .dx-treeview-toggle-item-visibility {
left: 10px;
right: auto;
}
// ##
.dx-icon {
width: $side-panel-min-width !important;
margin: 0 !important;
}
}

// ## Item levels customization
.dx-treeview-node {
&[aria-level='1'] {
font-weight: bold;
border-bottom: 1px solid $base-border-color;
// ##

// ## Arrow customization
.dx-treeview-node {
padding: 0 0 !important;
}
&[aria-level='2'] .dx-treeview-item-content {
font-weight: normal;
padding: 0 $side-panel-min-width;

.dx-treeview-toggle-item-visibility {
right: 10px;
left: auto;
}
}
// ##
}

// ## Selected & Focuced items customization
.dx-treeview {
.dx-treeview-node-container {
.dx-treeview-node {
&.dx-state-selected:not(.dx-state-focused)> .dx-treeview-item {
background: transparent;
}
.dx-rtl .dx-treeview-toggle-item-visibility {
left: 10px;
right: auto;
}
// ##

&.dx-state-selected > .dx-treeview-item * {
color: $base-accent;
// ## Item levels customization
.dx-treeview-node {
&[aria-level="1"] {
font-weight: bold;
}

&:not(.dx-state-focused)>.dx-treeview-item.dx-state-hover {
background-color: lighten($base-bg, 4.00);
&[aria-level="2"] .dx-treeview-item-content {
font-weight: normal;
padding: 0 $side-panel-min-width;
}
}
// ##
}
}

.dx-theme-generic .dx-treeview {
.dx-treeview-node-container .dx-treeview-node.dx-state-selected.dx-state-focused > .dx-treeview-item * {
color: inherit;
}
}
// ##
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import React, { useEffect, useRef, useCallback, useMemo } from 'react';
import React, { useEffect, useRef, useCallback, useMemo, useContext } from 'react';
import { TreeView<%=#isTypeScript%>, TreeViewRef<%=/isTypeScript%> } from 'devextreme-react/tree-view';
import * as events from 'devextreme/events';
import { navigation } from '../../app-navigation';
import { useNavigation } from '../../contexts/navigation';
import { useScreenSize } from '../../utils/media-query';
import './SideNavigationMenu.scss';
<%=#isTypeScript%>import type { SideNavigationMenuProps } from '../../types';<%=/isTypeScript%>

import * as events from 'devextreme/events';
import { ThemeContext } from '../../theme';

export default function SideNavigationMenu(props<%=#isTypeScript%>: React.PropsWithChildren<SideNavigationMenuProps><%=/isTypeScript%>) {
const {
Expand All @@ -17,6 +18,7 @@ export default function SideNavigationMenu(props<%=#isTypeScript%>: React.PropsW
onMenuReady
} = props;

const theme = useContext(ThemeContext);
const { isLarge } = useScreenSize();
function normalizePath () {
return navigation.map((item) => (
Expand Down Expand Up @@ -64,7 +66,7 @@ export default function SideNavigationMenu(props<%=#isTypeScript%>: React.PropsW

return (
<div
className={'dx-swatch-additional side-navigation-menu'}
className={`dx-swatch-additional${theme?.isDark() ? '-dark' : ''} side-navigation-menu`}
ref={getWrapperRef}
>
{children}
Expand Down
Loading
Loading