by Before Semicolon

importStyle()

importStyle details
Details
name importStyle
type function
arguments css file absolute path
description A utility function that will import CSS file, including CSS preprocessor files and returns a promise that resolves to plain modern CSS.

Arguments

file absolute path
type: string, required : a absolute path to the file to import.

Return

The function returns a promise that resolves to modern CSS text.

Usage Examples

This utility function was created to aid with custom tag style association. It is also a great way to compile any CSS into a modern one for the browser.

const {importStyle} = require('@before-semicolon/html-plus');
const path = require('path');

class SearchField {
	...

	static get style() {
		return importStyle(path.join(__dirname, './search-field.scss'))
	};

	...
}