Skip to content
This repository was archived by the owner on Dec 8, 2022. It is now read-only.

Commit 45b2935

Browse files
Adopted @skyux/theme (#458)
1 parent 4e9403b commit 45b2935

12 files changed

+14
-152
lines changed

config/karma/dev-src-app.karma.conf.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function getConfig(config) {
3939
webpackConfig.resolve.alias['@blackbaud/skyux-builder/runtime'] = runtimePath;
4040

4141
// Instead of adding skyux2 as a dependency of skyux-builder
42-
webpackConfig.resolve.alias['@blackbaud/skyux/dist/css/sky.css'] =
42+
webpackConfig.resolve.alias['@skyux/theme/css/sky.css'] =
4343
'../../utils/runtime-test-skyux.css';
4444

4545
// Remove sky-style-loader

config/webpack/alias-builder.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ module.exports = {
4141
// Order here is very important; the more specific CSS alias must go before
4242
// the more generic dist one.
4343
if (skyPagesConfig.skyux.cssPath) {
44-
alias['@blackbaud/skyux/dist/css/sky.css'] = spaPath(skyPagesConfig.skyux.cssPath);
44+
alias['@skyux/theme/css/sky.css'] = spaPath(skyPagesConfig.skyux.cssPath);
4545
}
4646

4747
if (skyPagesConfig.skyux.importPath) {

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
},
3030
"homepage": "https://github.com/blackbaud/skyux-builder#readme",
3131
"peerDependencies": {
32-
"@blackbaud/skyux": "^2.0.0"
32+
"@blackbaud/skyux": "^2.21.0"
3333
},
3434
"dependencies": {
3535
"@angular/animations": "4.3.6",

runtime/style-loader.spec.ts

-50
This file was deleted.

runtime/style-loader.ts

+3-33
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,3 @@
1-
import * as FontFaceObserver from 'fontfaceobserver';
2-
3-
import { Injectable } from '@angular/core';
4-
5-
@Injectable()
6-
export class SkyAppStyleLoader {
7-
public static readonly LOAD_TIMEOUT: number = 3000;
8-
public isLoaded: boolean = false;
9-
10-
public loadStyles(): Promise<any> {
11-
const fontAwesome = new FontFaceObserver('FontAwesome');
12-
const blackbaudSans = new FontFaceObserver('Blackbaud Sans');
13-
14-
return Promise
15-
.all([
16-
// Specify a character for FontAwesome since some browsers will fail to detect
17-
// when the font is loaded unless a known character with a different width
18-
// than the default is not specified.
19-
fontAwesome.load('\uf0fc', SkyAppStyleLoader.LOAD_TIMEOUT),
20-
blackbaudSans.load(undefined, SkyAppStyleLoader.LOAD_TIMEOUT)
21-
])
22-
.then(() => {
23-
this.isLoaded = true;
24-
})
25-
.catch((error) => {
26-
// Errors loading the font should not stop the page from rendering.
27-
// Passing the error along in case the client wants to do something with it.
28-
return Promise.resolve({
29-
error: error
30-
});
31-
});
32-
}
33-
}
1+
export {
2+
SkyAppStyleLoader
3+
} from '@skyux/theme/style-loader';

runtime/viewport.service.ts

+3-21
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,3 @@
1-
import {
2-
Injectable
3-
} from '@angular/core';
4-
5-
import { ReplaySubject } from 'rxjs/ReplaySubject';
6-
7-
/**
8-
* Provides information about the state of the application's viewport.
9-
*/
10-
@Injectable()
11-
export class SkyAppViewportService {
12-
13-
/**
14-
* Updated when the viewport becomes visible. While the page is rendered, the
15-
* viewport may remain hidden as fonts and styles are loaded asynchronously;
16-
* this is done to avoid a FOUC (Flash Of Unstyled Content) before the fonts
17-
* and styles are ready.
18-
*/
19-
public visible = new ReplaySubject<boolean>(1);
20-
21-
}
1+
export {
2+
SkyAppViewportService
3+
} from '@skyux/theme/viewport.service';

src/app/app.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import {
3131
SkyAppWindowRef
3232
} from '@blackbaud/skyux-builder/runtime';
3333

34-
require('style-loader!@blackbaud/skyux/dist/css/sky.css');
34+
require('style-loader!@skyux/theme/css/sky.css');
3535
require('style-loader!./app.component.scss');
3636

3737
let omnibarLoaded: boolean;

src/skyux.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
import '@blackbaud/skyux/dist/css/sky.css';
1+
import '@skyux/theme/css/sky.css';
22
import '@blackbaud/skyux/dist/core';

test/config-webpack-common.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ describe('config webpack common', () => {
8888
alias = config.resolve.alias;
8989

9090
expect(
91-
alias['@blackbaud/skyux/dist/css/sky.css']
91+
alias['@skyux/theme/css/sky.css']
9292
).toBe(path.join(process.cwd(), cssPath));
9393
});
9494

tsconfig.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
"types": [
1919
"core-js",
2020
"node",
21-
"jasmine",
22-
"fontfaceobserver"
21+
"jasmine"
2322
],
2423
"baseUrl": ".",
2524
"paths": {

utils/sky-style-loader.js

-39
This file was deleted.

utils/spec-styles.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
'use strict';
44

5-
var styleLoader = require('./sky-style-loader');
5+
const styleLoader = require('@skyux/theme/utils/node-js/style-loader');
66

77
// A race condition exists in Firefox where tests can begin before styles are loaded.
88
// This will ensure that styles are loaded before tests run by ensuring the style rule

0 commit comments

Comments
 (0)