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

Docs: add enterprise admonition #1198

Merged
merged 10 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from 6 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
2 changes: 1 addition & 1 deletion content/docs/capabilities/branding.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Add custom colors, logos, and error messages.

# Custom Branding / White Labeling

:::tip
:::enterprise Pomerium Enterprise

This article describes a use case available to [Pomerium Enterprise](/docs/deploy/enterprise/install) customers.

Expand Down
2 changes: 1 addition & 1 deletion content/docs/capabilities/original-request-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: This article describes how the original user context is passed seco

# Original User Context

:::tip
:::enterprise Pomerium Enterprise

This article describes a use case available to [Pomerium Enterprise](/docs/deploy/enterprise/install) customers.

Expand Down
4 changes: 4 additions & 0 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ const config = {
routeBasePath: '/',
sidebarPath: require.resolve('./sidebars.js'),
editUrl: 'https://github.com/pomerium/documentation/tree/main',
admonitions: {
keywords: ['note', 'tip', 'info', 'caution', 'danger', 'enterprise'],
extendDefaults: true,
},
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
Expand Down
26 changes: 26 additions & 0 deletions src/theme/Admonition/Types.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from 'react';
import DefaultAdmonitionTypes from '@theme-original/Admonition/Types';
import BusinessIcon from '@mui/icons-material/Business';

import './types.css';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're going to add a separate CSS file for this component, can it be scoped to just this component? (See src/theme/Footer/Logo/index.js for an example of using a CSS module.)


function EnterpriseAdmonition(props) {
return (
<div className="custom_admonition">
<div className="custom_admonition_header">
<span><BusinessIcon style={{color: 'rgb(86 83 83)'}}/></span>
<h5>{props.title}</h5>
</div>
<div className="custom_admonition_text">
<p>{props.children}</p>
</div>
</div>
);
}

const AdmonitionTypes = {
...DefaultAdmonitionTypes,
'enterprise': EnterpriseAdmonition,
}

export default AdmonitionTypes;
27 changes: 27 additions & 0 deletions src/theme/Admonition/types.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.custom_admonition {
border: #ededed 1px solid;
border-left: #6F43E7 solid 4px;
border-radius: 10px;
margin: 0 0 16px 0;
padding: 16px;
background-color: #f6f3ff;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we'll need a different set of colors for dark mode, as currently this has poor text contrast:

Screen Shot 2024-01-30 at 12 20 55 PM

}

.custom_admonition_header {
display: flex;
justify-content: flex-start;
}

.custom_admonition_header span {
margin-right: 5px;
}

.custom_admonition_header h5 {
color: #6F43E7;
font-size: 16px;
}

.custom_admonition_text p {
margin: 0 0 0 0;
font-size: 16px;
}