Skip to content

Commit

Permalink
Add sass variable overrides to theme
Browse files Browse the repository at this point in the history
Necessary to style components that are not yet converted to Emotion (elastic/eui#5685)
  • Loading branch information
jonathonherbert committed Mar 29, 2023
1 parent 5325bc3 commit 31c7962
Show file tree
Hide file tree
Showing 7 changed files with 407 additions and 10 deletions.
6 changes: 6 additions & 0 deletions apps/rule-manager/client/src/css/theme.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/* NB: Anything overridden in here must also be reflected in ts/constants/euiTheme.ts */
$euiBorderRadius: 0;
$euiBorderRadiusSmall: 0;
$euiFontFamily: 'Guardian Agate Sans', BlinkMacSystemFont, Helvetica, Arial, sans-serif;

@import "../../node_modules/@elastic/eui/src/themes/amsterdam/theme_light.scss";
9 changes: 3 additions & 6 deletions apps/rule-manager/client/src/ts/components/RulesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@ const columns: Array<EuiBasicTableColumn<Rule>> = [
},
{
field: 'id',
name: 'ID',
render: (id: Rule['id']) => {
return <>{id}</>
}
name: 'ID'
},
{
field: 'category',
Expand Down Expand Up @@ -84,11 +81,11 @@ const RulesTable = () => {
<EuiFlexGroup>
<EuiFlexItem grow={false} css={css`padding-bottom: 20px`}>
<EuiTitle>
<h1>Current rules ({rules ? rules.length : 'loading...'})</h1>
<h1>Current rules</h1>
</EuiTitle>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButton fill={true} color={"primary"} onClick={() => refreshRules()} isLoading={isRefreshing}>
<EuiButton size="s" fill={true} color={"primary"} onClick={() => refreshRules()} isLoading={isRefreshing}>
Refresh{isRefreshing ? "ing" : ""} rules
</EuiButton>
</EuiFlexItem>
Expand Down
1 change: 0 additions & 1 deletion apps/rule-manager/client/src/ts/components/pages/Rules.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from "react";
import '@elastic/eui/dist/eui_theme_light.css';
import {EuiPageSection} from "@elastic/eui";
import RulesTable from "../RulesTable";

Expand Down
7 changes: 7 additions & 0 deletions apps/rule-manager/client/src/ts/constants/euiTheme.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
/* NB: Anything overridden in here must also be reflected in styles/theme.scss */
export const euiThemeOverrides = {
"font": {
"family": "'Guardian Agate Sans', BlinkMacSystemFont, Helvetica, Arial, sans-serif"
},
"border": {
"radius": {
"small": "0",
"medium": "0"
}
}
};
8 changes: 5 additions & 3 deletions apps/rule-manager/client/src/ts/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import * as React from "react";
import * as ReactDOM from "react-dom";
import {Page} from "./components/layout/Page";
import "../css/theme.scss";
import "../css/reset.css";
import "../css/typography.css";
import "./constants/icons";

import * as React from "react";
import * as ReactDOM from "react-dom";
import {Page} from "./components/layout/Page";

// For development mode with Vite
import 'vite/modulepreload-polyfill';

Expand Down
Loading

0 comments on commit 31c7962

Please sign in to comment.