Skip to content

Commit

Permalink
BUGFIX: Only apply CSS theme variables to commandbar
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebobo committed Apr 17, 2023
1 parent e42a0c0 commit 19b1eb3
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
2 changes: 0 additions & 2 deletions packages/commandbar/src/CommandBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import React from 'react';
import { CommandBarStateProvider, IntlProvider } from './state';
import CommandBarDialog from './components/CommandBarDialog/CommandBarDialog';

import './Variables.module.css';

type CommandBarProps = {
commands: HierarchicalCommandList;
open: boolean;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
:root {
.commandBarTheme {
--bar-min-width: 600px;
--bar-max-width: 90vw;
--bar-width: 30vw;
Expand All @@ -19,10 +19,10 @@
--dialog-blur: 5px;

/* Neos UI colors */
--grayLight: #999;
--grayLight: #3f3f3f;
--grayLighter: #eee;
--grayMedium: #323232;
--grayDark: #3f3f3f;
--grayDark: #222;
--gray: #555;
--textSubtleLight: #adadad;
--textOnGray: #fff;
Expand Down
1 change: 1 addition & 0 deletions packages/commandbar/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ import CommandBar from './CommandBar';
export { CommandBar };
export { ToggleButton } from './components';
export { logger } from './helpers';
export { classnames } from './helpers';
5 changes: 3 additions & 2 deletions packages/module-plugin/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { Component } from 'preact';
import React from 'preact/compat';

import { CommandBar, logger, ToggleButton } from '@neos-commandbar/commandbar';
import { classnames, CommandBar, logger, ToggleButton } from '@neos-commandbar/commandbar';
import { PreferencesApi, CommandsApi, DocumentationApi, PackagesApi } from '@neos-commandbar/neos-api';
import IconComponent from './IconComponent';

import * as styles from './ModulePlugin.module.css';
import * as theme from '@neos-commandbar/commandbar/src/Theme.module.css';

/**
* This is a custom element that is used to render the command bar inside a shadow dom to prevent Neos and module
Expand Down Expand Up @@ -176,7 +177,7 @@ export default class App extends Component<
return (
<>
<style>{'@import "' + this.props.styleuri + '";'}</style>
<div className={styles.pluginWrap}>
<div className={classnames(styles.pluginWrap, theme.commandBarTheme)}>
<ToggleButton
handleToggle={this.handleToggle}
disabled={!initialized}
Expand Down
5 changes: 3 additions & 2 deletions packages/ui-plugin/src/CommandBarUiPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ import { neos } from '@neos-project/neos-ui-decorators';
import { selectors, actions } from '@neos-project/neos-ui-redux-store';
import { Icon } from '@neos-project/react-ui-components';

import { CommandBar, logger, ToggleButton } from '@neos-commandbar/commandbar';
import { CommandBar, logger, ToggleButton, classnames } from '@neos-commandbar/commandbar';
import { CommandsApi, PreferencesApi, DocumentationApi, NodesApi, PackagesApi } from '@neos-commandbar/neos-api';

import { actions as commandBarActions, NeosRootState, selectors as commandBarSelectors } from './actions';

import * as styles from './CommandBarUiPlugin.module.css';
import * as theme from '@neos-commandbar/commandbar/src/Theme.module.css';

type CommandBarUiPluginProps = {
addNode: (
Expand Down Expand Up @@ -516,7 +517,7 @@ class CommandBarUiPlugin extends React.PureComponent<CommandBarUiPluginProps, Co
this.state;

return (
<div className={styles.commandBarToolbarComponent}>
<div className={classnames(styles.commandBarToolbarComponent, theme.commandBarTheme)}>
<ToggleButton
handleToggle={toggleCommandBar}
disabled={!loaded}
Expand Down

0 comments on commit 19b1eb3

Please sign in to comment.