Skip to content

Commit

Permalink
restore import-css plugin (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
thescientist13 authored Nov 15, 2023
1 parent f653e47 commit a067dc8
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,18 @@ To add this plugin to an _existing_ Greenwood project (where `@greenwood/cli` ha

1. Install the plugin as a dev dependency
```sh
$ npm install greenwood-starter-presentation --save-dev
$ npm i greenwood-starter-presentation --save-dev --legacy-peer-deps
```
1. Add this plugin and all dependent plugins to your _greenwood.config.js_
1. Add this and Greenwood's Import CSS plugin to your _greenwood.config.js_
```js
import { greenwoodPluginImportCss } from '@greenwood/plugin-import-css';
import { greenwoodThemeStarterPresentation } from 'greenwood-starter-presentation';
export default {
// ...
plugins: [
greenwoodPluginImportCss(),
greenwoodThemeStarterPresentation()
]
Expand Down
2 changes: 2 additions & 0 deletions greenwood.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import fs from 'fs';
import { greenwoodThemeStarterPresentation } from './index.js';
import path from 'path';
import { ResourceInterface } from '@greenwood/cli/src/lib/resource-interface.js';
import { greenwoodPluginImportCss } from '@greenwood/plugin-import-css';

const packageName = JSON.parse(fs.readFileSync(path.join(process.cwd(), './package.json'), 'utf-8')).name;

Expand All @@ -27,6 +28,7 @@ class MyThemePackDevelopmentResource extends ResourceInterface {

export default {
plugins: [
greenwoodPluginImportCss(),
greenwoodThemeStarterPresentation({
__isDevelopment: true
}),
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@
"peerDependencies": {
"@greenwood/cli": "~0.29.0"
},
"dependencies": {
"@greenwood/plugin-import-css": "~0.29.0"
},
"devDependencies": {
"@greenwood/cli": "~0.29.0",
"@greenwood/plugin-import-css": "~0.29.0",
"eslint": "^8.4.0",
"rimraf": "^3.0.2",
"stylelint": "^13.12.0",
Expand Down
4 changes: 4 additions & 0 deletions src/components/presenter-mode.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import themeCss from '../styles/theme.css?type=css';

const template = document.createElement('template');

template.innerHTML = `
<style>
${themeCss}
.fullscreen-container {
display: none;
}
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,11 @@
unified "^9.2.0"
wc-compiler "~0.9.0"

"@greenwood/plugin-import-css@~0.29.0":
version "0.29.0"
resolved "https://registry.yarnpkg.com/@greenwood/plugin-import-css/-/plugin-import-css-0.29.0.tgz#bed9959e80d84f43ee28cc5ca6de6209691427fc"
integrity sha512-2FMk3qs8umOuR4bb4xSuW1bRGV1Pk1QS1QY6sk5BNhOIO5+ZphtuIrVTJUcfxHzLw4BBOG4Xws6LJCs5XfNfjw==

"@humanwhocodes/config-array@^0.9.2":
version "0.9.2"
resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.9.2.tgz#68be55c737023009dfc5fe245d51181bb6476914"
Expand Down

0 comments on commit a067dc8

Please sign in to comment.