This commit is contained in:
Seth Trowbridge 2025-10-06 10:19:10 -04:00
parent e0e881a754
commit 784ef673c8
2 changed files with 80 additions and 0 deletions

54
src/gale-2.js Normal file
View File

@ -0,0 +1,54 @@
Sheet({
fontSize:`12px`
},{
1024:
{
fontSize:`14px`
}
})
function Prox()
{
const obj = new Proxy({}, {
get(target, propName, receiver)
{
console.log("get:", propName)
return obj;
},
set(target, propName, value, receiver)
{
console.log("set:", propName)
return true;
}
})
return obj;
}
//
// const sheet = {};
//
// sheet
// .Font.size`8px`.color`#aabbcc`
// [512]
// .Font.size`10px`
// [1024]
// .Font.size`12px`
//
//
// sheet(1024,
// Font.size`12px`.color`#aabbcc`
// )(512,
// Font.size`10px`);
//
const p1 = Prox();
p1.read
p1.write = 123;

26
types.d.ts vendored
View File

@ -43,3 +43,29 @@ declare global {
}
declare global
{
namespace JSS
{
type Block = Partial<Record<keyof CSSStyleDeclaration, UnitValue>>
type Responsive = Record<number, Block>
type Unit = "px" | "em" | "rem" | "%" | "vh" | "vw" | "vmin" | "vmax" | "cm" | "mm" | "in" | "pt" | "pc" | "ch" | "ex"
type UnitValue = `${number}${Unit}` | [amount:number, unit:Unit]
type HexNumber = "1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"9"|"0"|"a"|"b"|"c"|"d"|"e"|"f"
type HexTriplet = `#${HexNumber}${HexNumber}${HexNumber}`
type HexColor = `#${HexNumber}${HexNumber}${HexNumber}${HexNumber}${HexNumber}${HexNumber}`
type Rules = {
fontSize: UnitValue,
letterSpacing: UnitValue
}
type SheetGen =(mobile:Block, conditions?:Responsive)=> void
}
const Sheet:JSS.SheetGen
}