If you're working on an angular-cli based project, here's how you can create your own theme using jQuery and UIKit:
Start by installing the dependencies:
npm install jquery --save
npm install uikit --save
Next, update your .angular-cli.json file with the required scripts:
...
"scripts": [
"../node_modules/jquery/dist/jquery.min.js",
"../node_modules/uikit/dist/js/uikit.min.js",
"../node_modules/uikit/dist/js/uikit-icons.min.js"
],
...
Now you can import UIKit in your Angular component and use it as needed:
import {Component} from "@angular/core";
declare var UIkit: any;
@Component({
template: `<div (click)="showAlert()">alert</div>`
})
export class OwnerComponent {
showAlert(): void {
UIkit.modal.alert('UIkit alert!');
}
}
In the next step, I'll explain how to configure the project to use Sass/SCSS for your custom UIKit theme:
Rename styles.css to styles.scss:
...
"styles": [
"styles.scss"
],
...
You can now edit styles.scss to compile UIKit and apply your custom theme:
// Customize variables and overwrites
$global-link-color: #DA7D02;
// Import default variables and mixins
@import "../node_modules/uikit/src/scss/variables-theme.scss";
@import "../node_modules/uikit/src/scss/mixins-theme.scss";
// Additional mixin modifications
@mixin hook-card() { color: #000; }
// Import UIkit
@import "../node_modules/uikit/src/scss/uikit-theme.scss";