@nypl/web-reader 1.2.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -131,23 +131,35 @@ The HTML Reader has the ability to inject custom elements into the reader iframe
131
131
 
132
132
  In the below example, we show two different ways to do this.
133
133
 
134
- 1. The `cssInjectableUrl` is loaded via webpack loaders. We export the Readium CSS stylesheets compiled under `@nypl/web-reader/dist/injectable-html-styles.css`. This can then be imported via webpack as a url to a static file that is copied to the dist folder. You can then use this url in your injectable config.
134
+ 1. We export the Readium CSS stylesheets compiled under `@nypl/web-reader/dist/injectable-html-styles/*.css`. These css files can then be imported via webpack as a url to a static file that is copied to the dist folder. You can then use this url in your injectable config.
135
135
  2. The `fontInjectable` uses a plain url to a css file that we host normally on our site. In this case you would be responsible for copying the css file into your source code and making sure it is hosted at some location.
136
136
 
137
137
  ```ts
138
- import cssInjectableUrl from '!file-loader!extract-loader!css-loader!@nypl/web-reader/dist/injectable-html-styles.css';
139
-
140
- const cssInjectable: Injectable = {
141
- type: 'style',
142
- url: htmlStyles,
143
- };
138
+ import readiumBefore from '!file-loader!extract-loader!css-loader!@nypl/web-reader/dist/injectable-html-styles/ReadiumCSS-before.css';
139
+ import readiumDefault from '!file-loader!extract-loader!css-loader!@nypl/web-reader/dist/injectable-html-styles/ReadiumCSS-default.css';
140
+ import readiumAfter from '!file-loader!extract-loader!css-loader!@nypl/web-reader/dist/injectable-html-styles/ReadiumCSS-after.css';
141
+
142
+ const cssInjectables: Injectable[] = [
143
+ {
144
+ type: 'style',
145
+ url: readiumBefore,
146
+ },
147
+ {
148
+ type: 'style',
149
+ url: readiumDefault,
150
+ },
151
+ {
152
+ type: 'style',
153
+ url: readiumAfter,
154
+ },
155
+ ];
144
156
  const fontInjectable: Injectable = {
145
157
  type: 'style',
146
158
  url: `${origin}/fonts/opendyslexic/opendyslexic.css`,
147
159
  fontFamily: 'opendyslexic',
148
160
  };
149
161
 
150
- const htmlInjectables = [cssInjectable, fontInjectable];
162
+ const htmlInjectables = [...cssInjectables, fontInjectable];
151
163
 
152
164
  const Reader = () => {
153
165
  return (