Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
46 changes: 2 additions & 44 deletions packages/html/stories/MenuStyle.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,46 +47,8 @@ import { globalTypes, globalValues } from './shared/args.js';
import { configureImagesBasePath, createGraphContainer } from './shared/configure.js';
// style required by RubberBand and MaxPopupMenu
import '@maxgraph/core/css/common.css';

// Use custom CSS for the popup menu
const CSS_TEMPLATE = `
body div.mxPopupMenu {
-webkit-box-shadow: 3px 3px 6px #C0C0C0;
-moz-box-shadow: 3px 3px 6px #C0C0C0;
box-shadow: 3px 3px 6px #C0C0C0;
background: white;
position: absolute;
border: 3px solid #e7e7e7;
padding: 3px;
}
body table.mxPopupMenu {
border-collapse: collapse;
margin: 0px;
}
body tr.mxPopupMenuItem {
color: black;
cursor: default;
}
body td.mxPopupMenuItem {
padding: 6px 60px 6px 30px;
font-family: Arial;
font-size: 10pt;
}
body td.mxPopupMenuIcon {
background-color: white;
padding: 0px;
}
body tr.mxPopupMenuItemHover {
background-color: #eeeeee;
color: black;
}
table.mxPopupMenu hr {
border-top: solid 1px #cccccc;
}
table.mxPopupMenu tr {
font-size: 4pt;
}
`;
// custom style for Popup Menu
import './css/menu-style.css';

export default {
title: 'Misc/MenuStyle',
Expand All @@ -101,10 +63,6 @@ export default {
const Template = ({ label, ...args }: Record<string, string>) => {
configureImagesBasePath();

const styleElm = document.createElement('style');
styleElm.innerText = CSS_TEMPLATE;
document.head.appendChild(styleElm);

const container = createGraphContainer(args);

// Disables built-in context menu
Expand Down
45 changes: 2 additions & 43 deletions packages/html/stories/ShowRegion.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,45 +44,8 @@ import {
import { createGraphContainer } from './shared/configure.js';
// style required by RubberBand and MaxPopupMenu
import '@maxgraph/core/css/common.css';

const CSS_TEMPLATE = `
body div.mxPopupMenu {
-webkit-box-shadow: 3px 3px 6px #C0C0C0;
-moz-box-shadow: 3px 3px 6px #C0C0C0;
box-shadow: 3px 3px 6px #C0C0C0;
background: white;
position: absolute;
border: 3px solid #e7e7e7;
padding: 3px;
}
body table.mxPopupMenu {
border-collapse: collapse;
margin: 0px;
}
body tr.mxPopupMenuItem {
color: black;
cursor: default;
}
body td.mxPopupMenuItem {
padding: 6px 60px 6px 30px;
font-family: Arial;
font-size: 10pt;
}
body td.mxPopupMenuIcon {
background-color: white;
padding: 0px;
}
body tr.mxPopupMenuItemHover {
background-color: #eeeeee;
color: black;
}
table.mxPopupMenu hr {
border-top: solid 1px #cccccc;
}
table.mxPopupMenu tr {
font-size: 4pt;
}
`;
// custom style for Popup Menu
import './css/show-region.css';

export default {
title: 'Misc/ShowRegion',
Expand All @@ -97,10 +60,6 @@ export default {
};

const Template = ({ label, ...args }: Record<string, string>) => {
const styleElm = document.createElement('style');
styleElm.innerText = CSS_TEMPLATE;
document.head.appendChild(styleElm);

const mainDiv = document.createElement('div');
const divMessage = document.createElement('div');
divMessage.innerHTML =
Expand Down
36 changes: 36 additions & 0 deletions packages/html/stories/css/menu-style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
body div.mxPopupMenu {
-webkit-box-shadow: 3px 3px 6px #C0C0C0;
-moz-box-shadow: 3px 3px 6px #C0C0C0;
box-shadow: 3px 3px 6px #C0C0C0;
background: white;
position: absolute;
border: 3px solid #e7e7e7;
padding: 3px;
}
body table.mxPopupMenu {
border-collapse: collapse;
margin: 0;
}
body tr.mxPopupMenuItem {
color: black;
cursor: default;
}
body td.mxPopupMenuItem {
padding: 6px 60px 6px 30px;
font-family: Arial, sans-serif;
font-size: 10pt;
}
body td.mxPopupMenuIcon {
background-color: white;
padding: 0;
}
body tr.mxPopupMenuItemHover {
background-color: #eeeeee;
color: black;
}
table.mxPopupMenu hr {
border-top: solid 1px #cccccc;
}
table.mxPopupMenu tr {
font-size: 4pt;
}
1 change: 1 addition & 0 deletions packages/html/stories/css/show-region.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import "menu-style.css";