main: Stop importing patternfly.css

* Stop importing cockpit's base1/patternfly.css

This is deprecated API and will be dropped at some point, in favor
of projects shipping their own CSS.

Install and import the styles from PF4 now.

* Use webpack based string replacement for removing the font-face rules from PF4

Doing the seddery in Makefile breaks `npm run build`, webpack watching,
and is generally brittle.
Do the font replacement hacking with `string-replace-loader`, which fits into webpack much more nicely.

There is still some potential simplification by not duplicating the
entire scss loader chain.

Co-authored-by: Martin Pitt <martin@piware.de>

Closes #315
This commit is contained in:
Katerina Koukiou 2020-05-28 10:01:31 +02:00 committed by GitHub
parent 8adad16874
commit 96514e279e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 178 additions and 19 deletions

View file

@ -19,6 +19,7 @@
import cockpit from 'cockpit';
import React from 'react';
import { Alert, Card, CardHead, CardHeader, CardHeadMain, Title } from '@patternfly/react-core';
import './app.scss';
const _ = cockpit.gettext;
@ -35,12 +36,19 @@ export class Application extends React.Component {
render() {
return (
<div className="container-fluid">
<h2>Starter Kit</h2>
<p>
{ cockpit.format(_("Running on $0"), this.state.hostname) }
</p>
</div>
<Card>
<CardHead>
<CardHeadMain>
<Title headingLevel="h2" size="3xl">Starter Kit</Title>
</CardHeadMain>
</CardHead>
<CardHeader>
<Alert
variant="default"
title={ cockpit.format(_("Running on $0"), this.state.hostname) }
/>
</CardHeader>
</Card>
);
}
}