@acepad/css
v1.0.0
Published
NOTE: This package is supporsed to work in [acepad](https://github.com/hoge1e3/acepad-dev), not a regular node envronment.
Downloads
7
Readme
NOTE: This package is supporsed to work in acepad, not a regular node envronment.
@acepad/css
Load css file in acepad.
functions
css(base:string,path:string) (default export)- Load css from specified file
path. - if
pathis absolute,basecan be omitted. - Specify
import.meta.urlasbaseandpathas the relative path to the CSS file from the program calling this function. - After loading the CSS file, if the file is changed, the style will be changes when
css()for the CSS file is called again.
- Load css from specified file
Example
test.js
import css from "@acepad/css";
import * as assert from "assert";
import {show} from "@acepad/widget";
export async function main(){
const w=show();
w.element.classList.add("test");
w.element.innerHTML="TEST";
css(import.meta.url, "./test.css");
} test.css (It should be same directory of test.js)
.test{
color: red;
}How to run:
- Launch acepad.
- Open
node_modules/@acepad/css/test/test-css.js - Press F5
- Rewrite
test.cssand runtest-css.jsagain, the style will be changed.
