Skip to content

Commit ec19900

Browse files
committed
OCPBUGS-65887: Ban all colours and update README
1 parent 7016f3b commit ec19900

File tree

2 files changed

+29
-25
lines changed

2 files changed

+29
-25
lines changed

.stylelintrc.yaml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
11
extends:
22
- stylelint-config-standard
33
rules:
4-
# Disallow color names and hex colors as these don't work well with dark mode.
5-
# Use PF global variables instead:
6-
# https://patternfly-react-main.surge.sh/developer-resources/global-css-variables#global-css-variables
4+
# Disallow custom colors as these don't work well with dark mode.
5+
# Use PF semantic tokens instead:
6+
# https://www.patternfly.org/tokens/all-patternfly-tokens
77
color-named: never
88
color-no-hex: true
9-
# PatternFly CSS vars don't conform to stylelint's regex. Disable this rule.
10-
custom-property-pattern: null
119
function-disallowed-list:
1210
- rgb
13-
# Disable the standard rule to allow BEM-style classnames with underscores.
11+
- rgba
12+
- hsl
13+
- hsla
14+
- oklch
15+
- oklch
16+
- hwb
17+
- lab
18+
- lch
19+
# PatternFly CSS vars don't conform to stylelint's regex. Disable this rule.
20+
custom-property-pattern: null
21+
# Disable the standard rule to allow BEM-style class names with underscores.
1422
selector-class-pattern: null
15-
# Disallow CSS classnames prefixed with .pf- or .co- as these prefixes are
23+
# Disallow CSS class names prefixed with .pf- or .co- as these prefixes are
1624
# reserved by PatternFly and OpenShift console.
1725
selector-disallowed-list:
1826
- "*"

README.md

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
1-
# OpenShift Console Plugin Template
1+
# OpenShift console plugin template
22

33
This project is a minimal template for writing a new OpenShift Console dynamic
44
plugin.
55

6-
[Dynamic plugins](https://github.com/openshift/console/tree/master/frontend/packages/console-dynamic-plugin-sdk)
7-
allow you to extend the
8-
[OpenShift UI](https://github.com/openshift/console)
6+
[Openshift console plugins](https://github.com/openshift/console/tree/master/frontend/packages/console-dynamic-plugin-sdk)
7+
allow you to extend the [OpenShift web console](https://github.com/openshift/console)
98
at runtime, adding custom pages and other extensions. They are based on
109
[webpack module federation](https://webpack.js.org/concepts/module-federation/).
1110
Plugins are registered with console using the `ConsolePlugin` custom resource
1211
and enabled in the console operator config by a cluster administrator.
1312

14-
Using the latest `v1` API version of `ConsolePlugin` CRD, requires OpenShift 4.12
15-
and higher. For using old `v1alpha1` API version us OpenShift version 4.10 or 4.11.
16-
17-
For an example of a plugin that works with OpenShift 4.11, see the `release-4.11` branch.
18-
For a plugin that works with OpenShift 4.10, see the `release-4.10` branch.
13+
The `main` branch of this repository contains an example plugin which works
14+
with the latest version. To see an example of a plugin which works with an older
15+
version, visit the appropriate `release-4.x` branch.
1916

2017
[Node.js](https://nodejs.org/en/) and [yarn](https://yarnpkg.com) are required
2118
to build and run the example. To run OpenShift console in a container, either
@@ -24,17 +21,17 @@ to build and run the example. To run OpenShift console in a container, either
2421

2522
## Getting started
2623

27-
> [!IMPORTANT]
24+
> [!IMPORTANT]
2825
> To use this template, **DO NOT FORK THIS REPOSITORY**! Click **Use this template**, then select
29-
> [**Create a new repository**](https://github.com/new?template_name=networking-console-plugin&template_owner=openshift)
26+
> [**Create a new repository**](https://github.com/new?template_name=console-plugin-template&template_owner=openshift)
3027
> to create a new repository.
3128
>
3229
> ![A screenshot showing where the "Use this template" button is located](https://i.imgur.com/AhaySbU.png)
3330
>
3431
> **Forking this repository** for purposes outside of contributing to this repository
3532
> **will cause issues**, as users cannot have more than one fork of a template repository
3633
> at a time. This could prevent future users from forking and contributing to your plugin.
37-
>
34+
>
3835
> Your fork would also behave like a template repository, which might be confusing for
3936
> contributiors, because it is not possible for repositories generated from a template
4037
> repository to contribute back to the template.
@@ -177,7 +174,7 @@ naming conflicts. For example, the plugin template uses the
177174
with this namespace as follows:
178175

179176
```tsx
180-
conster Header: React.FC = () => {
177+
const Header: React.FC = () => {
181178
const { t } = useTranslation('plugin__console-plugin-template');
182179
return <h1>{t('Hello, World!')}</h1>;
183180
};
@@ -207,15 +204,14 @@ plugin template when adding or changing messages.
207204
This project adds prettier, eslint, and stylelint. Linting can be run with
208205
`yarn run lint`.
209206

210-
The stylelint config disallows hex colors since these cause problems with dark
211-
mode (starting in OpenShift console 4.11). You should use the
212-
[PatternFly global CSS variables](https://patternfly-react-main.surge.sh/developer-resources/global-css-variables#global-css-variables)
207+
The stylelint config disallows defining colors since these cause problems with dark
208+
mode. Use [PatternFly semantic tokens](https://www.patternfly.org/tokens/all-patternfly-tokens)
213209
for colors instead.
214210

215211
The stylelint config also disallows naked element selectors like `table` and
216212
`.pf-` or `.co-` prefixed classes. This prevents plugins from accidentally
217213
overwriting default console styles, breaking the layout of existing pages. The
218-
best practice is to prefix your CSS classnames with your plugin name to avoid
214+
best practice is to prefix your CSS class names with your plugin name to avoid
219215
conflicts. Please don't disable these rules without understanding how they can
220216
break console styles!
221217

@@ -225,7 +221,7 @@ Steps to generate reports
225221

226222
1. In command prompt, navigate to root folder and execute the command `yarn run cypress-merge`
227223
2. Then execute command `yarn run cypress-generate`
228-
The cypress-report.html file is generated and should be in (/integration-tests/screenshots) directory
224+
The cypress-report.html file is generated and should be in (/integration-tests/screenshots) directory.
229225

230226
## References
231227

0 commit comments

Comments
 (0)