Skip to content

Commit

Permalink
VS Code Dark Mode Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mgubaidullin committed Sep 19, 2024
1 parent cdef752 commit 8bcc1c5
Show file tree
Hide file tree
Showing 13 changed files with 57 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,3 +263,8 @@
.karavan .properties .component-headers .pf-v5-c-clipboard-copy.pf-m-inline {
background-color: transparent;
}

.karavan .properties .value-changed {
background-color: yellow;
}

Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,10 @@ export function ComponentPropertyField(props: Props) {


function getLabel(property: ComponentProperty, value: any) {
const bgColor = PropertyUtil.hasComponentPropertyValueChanged(property, value) ? 'yellow' : 'transparent';
const labelClassName = PropertyUtil.hasComponentPropertyValueChanged(property, value) ? 'value-changed' : 'transparent';
return (
<div style={{display: "flex", flexDirection: 'row', alignItems: 'center', gap: '3px'}}>
<Text style={{backgroundColor: bgColor}}>{property.displayName}</Text>
<Text className={labelClassName}>{property.displayName}</Text>
</div>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export function DslPropertyField(props: Props) {
}

function getLabel(property: PropertyMeta, value: any, isKamelet: boolean) {
const bgColor = PropertyUtil.hasDslPropertyValueChanged(property, value) ? 'yellow' : 'transparent';
const labelClassName = PropertyUtil.hasDslPropertyValueChanged(property, value) ? 'value-changed' : '';
if (!isMultiValueField(property) && property.isObject && !property.isArray && !["ExpressionDefinition"].includes(property.type)) {
const tooltip = value ? "Delete " + property.name : "Add " + property.name;
const className = value ? "change-button delete-button" : "change-button add-button";
Expand All @@ -219,7 +219,7 @@ export function DslPropertyField(props: Props) {
const icon = value ? (<DeleteIcon/>) : (<AddIcon/>);
return (
<div style={{display: "flex"}}>
<Text style={{backgroundColor: bgColor}}>{title}</Text>
<Text className={labelClassName}>{title}</Text>
<Tooltip position={"top"} content={<div>{tooltip}</div>}>
<button className={className} onClick={e => props.onPropertyChange?.(property.name, x)}
aria-label="Add element">
Expand All @@ -234,7 +234,7 @@ export function DslPropertyField(props: Props) {
} else if (!["ExpressionDefinition"].includes(property.type)) {
return (
<div style={{display: "flex", flexDirection: 'row', alignItems: 'center', gap: '3px'}}>
<Text style={{backgroundColor: bgColor}}>{CamelUtil.capitalizeName(property.displayName)}</Text>
<Text style={{backgroundColor: labelClassName}}>{CamelUtil.capitalizeName(property.displayName)}</Text>
</div>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,10 @@ export function KameletPropertyField(props: Props) {
}

function getLabel(property: Property, value: any) {
const bgColor = hasValueChanged(property, value) ? 'yellow' : 'transparent';
const labelClassName = hasValueChanged(property, value) ? 'value-changed' : 'transparent';
return (
<div style={{display: "flex", flexDirection: 'row', alignItems: 'center', gap: '3px'}}>
<Text style={{backgroundColor: bgColor}}>{property.title}</Text>
<Text className={labelClassName}>{property.title}</Text>
</div>
)
}
Expand Down
5 changes: 5 additions & 0 deletions karavan-designer/src/designer/property/DslProperties.css
Original file line number Diff line number Diff line change
Expand Up @@ -263,3 +263,8 @@
.karavan .properties .component-headers .pf-v5-c-clipboard-copy.pf-m-inline {
background-color: transparent;
}

.karavan .properties .value-changed {
background-color: yellow;
}

Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,10 @@ export function ComponentPropertyField(props: Props) {


function getLabel(property: ComponentProperty, value: any) {
const bgColor = PropertyUtil.hasComponentPropertyValueChanged(property, value) ? 'yellow' : 'transparent';
const labelClassName = PropertyUtil.hasComponentPropertyValueChanged(property, value) ? 'value-changed' : 'transparent';
return (
<div style={{display: "flex", flexDirection: 'row', alignItems: 'center', gap: '3px'}}>
<Text style={{backgroundColor: bgColor}}>{property.displayName}</Text>
<Text className={labelClassName}>{property.displayName}</Text>
</div>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export function DslPropertyField(props: Props) {
}

function getLabel(property: PropertyMeta, value: any, isKamelet: boolean) {
const bgColor = PropertyUtil.hasDslPropertyValueChanged(property, value) ? 'yellow' : 'transparent';
const labelClassName = PropertyUtil.hasDslPropertyValueChanged(property, value) ? 'value-changed' : '';
if (!isMultiValueField(property) && property.isObject && !property.isArray && !["ExpressionDefinition"].includes(property.type)) {
const tooltip = value ? "Delete " + property.name : "Add " + property.name;
const className = value ? "change-button delete-button" : "change-button add-button";
Expand All @@ -219,7 +219,7 @@ export function DslPropertyField(props: Props) {
const icon = value ? (<DeleteIcon/>) : (<AddIcon/>);
return (
<div style={{display: "flex"}}>
<Text style={{backgroundColor: bgColor}}>{title}</Text>
<Text className={labelClassName}>{title}</Text>
<Tooltip position={"top"} content={<div>{tooltip}</div>}>
<button className={className} onClick={e => props.onPropertyChange?.(property.name, x)}
aria-label="Add element">
Expand All @@ -234,7 +234,7 @@ export function DslPropertyField(props: Props) {
} else if (!["ExpressionDefinition"].includes(property.type)) {
return (
<div style={{display: "flex", flexDirection: 'row', alignItems: 'center', gap: '3px'}}>
<Text style={{backgroundColor: bgColor}}>{CamelUtil.capitalizeName(property.displayName)}</Text>
<Text style={{backgroundColor: labelClassName}}>{CamelUtil.capitalizeName(property.displayName)}</Text>
</div>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,10 @@ export function KameletPropertyField(props: Props) {
}

function getLabel(property: Property, value: any) {
const bgColor = hasValueChanged(property, value) ? 'yellow' : 'transparent';
const labelClassName = hasValueChanged(property, value) ? 'value-changed' : 'transparent';
return (
<div style={{display: "flex", flexDirection: 'row', alignItems: 'center', gap: '3px'}}>
<Text style={{backgroundColor: bgColor}}>{property.title}</Text>
<Text className={labelClassName}>{property.title}</Text>
</div>
)
}
Expand Down
5 changes: 5 additions & 0 deletions karavan-space/src/designer/property/DslProperties.css
Original file line number Diff line number Diff line change
Expand Up @@ -263,3 +263,8 @@
.karavan .properties .component-headers .pf-v5-c-clipboard-copy.pf-m-inline {
background-color: transparent;
}

.karavan .properties .value-changed {
background-color: yellow;
}

Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,10 @@ export function ComponentPropertyField(props: Props) {


function getLabel(property: ComponentProperty, value: any) {
const bgColor = PropertyUtil.hasComponentPropertyValueChanged(property, value) ? 'yellow' : 'transparent';
const labelClassName = PropertyUtil.hasComponentPropertyValueChanged(property, value) ? 'value-changed' : 'transparent';
return (
<div style={{display: "flex", flexDirection: 'row', alignItems: 'center', gap: '3px'}}>
<Text style={{backgroundColor: bgColor}}>{property.displayName}</Text>
<Text className={labelClassName}>{property.displayName}</Text>
</div>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export function DslPropertyField(props: Props) {
}

function getLabel(property: PropertyMeta, value: any, isKamelet: boolean) {
const bgColor = PropertyUtil.hasDslPropertyValueChanged(property, value) ? 'yellow' : 'transparent';
const labelClassName = PropertyUtil.hasDslPropertyValueChanged(property, value) ? 'value-changed' : '';
if (!isMultiValueField(property) && property.isObject && !property.isArray && !["ExpressionDefinition"].includes(property.type)) {
const tooltip = value ? "Delete " + property.name : "Add " + property.name;
const className = value ? "change-button delete-button" : "change-button add-button";
Expand All @@ -219,7 +219,7 @@ export function DslPropertyField(props: Props) {
const icon = value ? (<DeleteIcon/>) : (<AddIcon/>);
return (
<div style={{display: "flex"}}>
<Text style={{backgroundColor: bgColor}}>{title}</Text>
<Text className={labelClassName}>{title}</Text>
<Tooltip position={"top"} content={<div>{tooltip}</div>}>
<button className={className} onClick={e => props.onPropertyChange?.(property.name, x)}
aria-label="Add element">
Expand All @@ -234,7 +234,7 @@ export function DslPropertyField(props: Props) {
} else if (!["ExpressionDefinition"].includes(property.type)) {
return (
<div style={{display: "flex", flexDirection: 'row', alignItems: 'center', gap: '3px'}}>
<Text style={{backgroundColor: bgColor}}>{CamelUtil.capitalizeName(property.displayName)}</Text>
<Text style={{backgroundColor: labelClassName}}>{CamelUtil.capitalizeName(property.displayName)}</Text>
</div>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,10 @@ export function KameletPropertyField(props: Props) {
}

function getLabel(property: Property, value: any) {
const bgColor = hasValueChanged(property, value) ? 'yellow' : 'transparent';
const labelClassName = hasValueChanged(property, value) ? 'value-changed' : 'transparent';
return (
<div style={{display: "flex", flexDirection: 'row', alignItems: 'center', gap: '3px'}}>
<Text style={{backgroundColor: bgColor}}>{property.title}</Text>
<Text className={labelClassName}>{property.title}</Text>
</div>
)
}
Expand Down
29 changes: 21 additions & 8 deletions karavan-vscode/webview/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ body, :root, #root, .karavan {
/* margin-bottom: 0; */
}

.vscode-dark .karavan .properties .value-changed {
color: black;
}

.vscode-dark .karavan .pf-v5-c-drawer__splitter {
background: var(--vscode-tab-inactiveBackground);
}
Expand Down Expand Up @@ -334,6 +338,14 @@ body, :root, #root, .karavan {
}

/* Modal */
.vscode-dark .dsl-modal .pf-v5-c-page__main-section.pf-m-dark-100 {
--pf-v5-c-page__main-section--BackgroundColor: transparent;
}

.vscode-dark .dsl-modal .pf-v5-c-toggle-group .pf-v5-c-toggle-group__button.pf-m-selected {
/* --pf-v5-c-toggle-group__button--BackgroundColor: var(--pf-v5-global--primary-color--200); */
}

.vscode-dark .dsl-modal .dsl-card .icon {
height: 24px;
background: var(--pf-v5-global--BorderColor--200);
Expand All @@ -342,6 +354,15 @@ body, :root, #root, .karavan {
padding: 4px;
}

.vscode-dark .dsl-modal .dsl-card:hover {
background-color: var(--pf-v5-global--palette--black-500);
}

.vscode-dark .dsl-modal .dsl-card:hover .labels {
background-color: var(--pf-v5-global--palette--black-700);
--pf-v5-c-badge--Color: var(--pf-v5-c-badge--m-unread--Color);
}

.vscode-dark .pf-v5-c-modal-box {
--pf-v5-c-modal-box--BackgroundColor: var(--vscode-input-background);
}
Expand Down Expand Up @@ -467,14 +488,6 @@ color: var(--vscode-editor-foreground);
background-color: transparent;
}

.vscode-dark .dsl-modal .pf-v5-c-page__main-section.pf-m-dark-100 {
--pf-v5-c-page__main-section--BackgroundColor: transparent;
}

.vscode-dark .dsl-modal .pf-v5-c-toggle-group .pf-v5-c-toggle-group__button.pf-m-selected {
--pf-v5-c-toggle-group__button--BackgroundColor: var(--pf-v5-global--primary-color--200);
}

#root .karavan .bean-designer {
padding-bottom: 0;
}
Expand Down

0 comments on commit 8bcc1c5

Please sign in to comment.