@editio-ui/react 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/button/button.d.ts +17 -0
- package/dist/components/button/button.js +11 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/checkbox/checkbox.d.ts +23 -0
- package/dist/components/checkbox/checkbox.js +19 -0
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/input/index.d.ts +2 -0
- package/dist/components/input/input.d.ts +15 -0
- package/dist/components/input/input.js +14 -0
- package/dist/components/radio-group/index.d.ts +2 -0
- package/dist/components/radio-group/radio-group.d.ts +31 -0
- package/dist/components/radio-group/radio-group.js +47 -0
- package/dist/components/separator/index.d.ts +2 -0
- package/dist/components/separator/separator.d.ts +18 -0
- package/dist/components/separator/separator.js +13 -0
- package/dist/components/switch/index.d.ts +2 -0
- package/dist/components/switch/switch.d.ts +7 -0
- package/dist/components/switch/switch.js +12 -0
- package/dist/components/textarea/index.d.ts +2 -0
- package/dist/components/textarea/textarea.d.ts +15 -0
- package/dist/components/textarea/textarea.js +14 -0
- package/dist/editorial/backgrounds.css +201 -0
- package/dist/editorial/buttons.css +209 -0
- package/dist/editorial/choices.css +360 -0
- package/dist/editorial/disclosure.css +359 -0
- package/dist/editorial/feedback.css +272 -0
- package/dist/editorial/fields.css +205 -0
- package/dist/editorial/motion.css +184 -0
- package/dist/editorial/showcase.css +395 -0
- package/dist/editorial/tokens.css +129 -0
- package/dist/editorial/type.css +379 -0
- package/dist/editorial-fonts.css +4 -0
- package/dist/editorial.css +2704 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +8 -0
- package/package.json +74 -4
- package/README.md +0 -3
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Props for {@link Button}: every native `<button>` attribute and event
|
|
4
|
+
* handler (`disabled`, `onClick`, `aria-*`, `data-*`, `className`, `style`...).
|
|
5
|
+
* Editio adds no props of its own, so the type is the native one.
|
|
6
|
+
*/
|
|
7
|
+
export type ButtonProps = ComponentPropsWithoutRef<"button">;
|
|
8
|
+
/**
|
|
9
|
+
* A native `<button>` with no imposed styling.
|
|
10
|
+
*
|
|
11
|
+
* Keyboard behavior (Enter and Space activate it, Tab focuses it) and
|
|
12
|
+
* disabled behavior come from the browser, not from Editio code.
|
|
13
|
+
*
|
|
14
|
+
* `type` defaults to `"button"` so a Button inside a `<form>` does not submit
|
|
15
|
+
* it by accident. Pass `type="submit"` to opt in.
|
|
16
|
+
*/
|
|
17
|
+
export declare const Button: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { forwardRef as e } from "react";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
// src/components/button/button.tsx
|
|
4
|
+
var n = e(function({ type: e = "button", ...n }, r) {
|
|
5
|
+
return /* @__PURE__ */ t("button", {
|
|
6
|
+
ref: r,
|
|
7
|
+
type: e,
|
|
8
|
+
...n
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
export { n as Button };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from "react";
|
|
2
|
+
export type CheckboxProps = Omit<ComponentPropsWithoutRef<"input">, "type"> & {
|
|
3
|
+
/** Called with the new checked state. Use with `checked` for controlled mode. */
|
|
4
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
5
|
+
/** Shows the mixed state. Purely visual and announced; it does not change `checked`. */
|
|
6
|
+
indeterminate?: boolean;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* A native `<input type="checkbox">`.
|
|
10
|
+
*
|
|
11
|
+
* Because it is the real element, keyboard behavior (Space toggles), form
|
|
12
|
+
* submission and label association all work without extra code. Style it with
|
|
13
|
+
* `appearance: none` plus `:checked` and `:indeterminate`.
|
|
14
|
+
*
|
|
15
|
+
* Controlled: pass `checked` and `onCheckedChange`.
|
|
16
|
+
* Uncontrolled: pass `defaultChecked` (or nothing).
|
|
17
|
+
*/
|
|
18
|
+
export declare const Checkbox: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "type"> & {
|
|
19
|
+
/** Called with the new checked state. Use with `checked` for controlled mode. */
|
|
20
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
21
|
+
/** Shows the mixed state. Purely visual and announced; it does not change `checked`. */
|
|
22
|
+
indeterminate?: boolean;
|
|
23
|
+
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { forwardRef as e, useEffect as t, useImperativeHandle as n, useRef as r } from "react";
|
|
2
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
3
|
+
// src/components/checkbox/checkbox.tsx
|
|
4
|
+
var a = e(function({ onCheckedChange: e, onChange: a, indeterminate: o = !1, ...s }, c) {
|
|
5
|
+
let l = r(null);
|
|
6
|
+
n(c, () => l.current), t(() => {
|
|
7
|
+
l.current && (l.current.indeterminate = o);
|
|
8
|
+
}, [o, s.checked]);
|
|
9
|
+
function u(t) {
|
|
10
|
+
a?.(t), e?.(t.target.checked);
|
|
11
|
+
}
|
|
12
|
+
return /* @__PURE__ */ i("input", {
|
|
13
|
+
...s,
|
|
14
|
+
ref: l,
|
|
15
|
+
type: "checkbox",
|
|
16
|
+
onChange: u
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
export { a as Checkbox };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from "react";
|
|
2
|
+
export type InputProps = ComponentPropsWithoutRef<"input"> & {
|
|
3
|
+
/** Called with the new text. Use with `value` for controlled mode. */
|
|
4
|
+
onValueChange?: (value: string) => void;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* A native `<input>`. Pass `type` ("email", "password", "search"...) as usual.
|
|
8
|
+
*
|
|
9
|
+
* Controlled: pass `value` and `onValueChange`.
|
|
10
|
+
* Uncontrolled: pass `defaultValue` (or nothing).
|
|
11
|
+
*/
|
|
12
|
+
export declare const Input: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & {
|
|
13
|
+
/** Called with the new text. Use with `value` for controlled mode. */
|
|
14
|
+
onValueChange?: (value: string) => void;
|
|
15
|
+
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { forwardRef as e } from "react";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
// src/components/input/input.tsx
|
|
4
|
+
var n = e(function({ onValueChange: e, onChange: n, ...r }, i) {
|
|
5
|
+
function a(t) {
|
|
6
|
+
n?.(t), e?.(t.target.value);
|
|
7
|
+
}
|
|
8
|
+
return /* @__PURE__ */ t("input", {
|
|
9
|
+
...r,
|
|
10
|
+
ref: i,
|
|
11
|
+
onChange: a
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
export { n as Input };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from "react";
|
|
2
|
+
export type RadioGroupRootProps = Omit<ComponentPropsWithoutRef<"div">, "defaultValue" | "onChange" | "role"> & {
|
|
3
|
+
/** Selected value. Use with `onValueChange` for controlled mode. */
|
|
4
|
+
value?: string;
|
|
5
|
+
/** Initially selected value for uncontrolled mode. */
|
|
6
|
+
defaultValue?: string;
|
|
7
|
+
onValueChange?: (value: string) => void;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
required?: boolean;
|
|
10
|
+
/** Form field name. A unique one is generated if you omit it. */
|
|
11
|
+
name?: string;
|
|
12
|
+
};
|
|
13
|
+
export type RadioGroupItemProps = Omit<ComponentPropsWithoutRef<"input">, "type" | "checked" | "defaultChecked" | "name" | "value" | "onChange"> & {
|
|
14
|
+
value: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const RadioGroup: {
|
|
17
|
+
readonly Root: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "defaultValue" | "onChange" | "role"> & {
|
|
18
|
+
/** Selected value. Use with `onValueChange` for controlled mode. */
|
|
19
|
+
value?: string;
|
|
20
|
+
/** Initially selected value for uncontrolled mode. */
|
|
21
|
+
defaultValue?: string;
|
|
22
|
+
onValueChange?: (value: string) => void;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
required?: boolean;
|
|
25
|
+
/** Form field name. A unique one is generated if you omit it. */
|
|
26
|
+
name?: string;
|
|
27
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
28
|
+
readonly Item: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "checked" | "defaultChecked" | "name" | "onChange" | "type" | "value"> & {
|
|
29
|
+
value: string;
|
|
30
|
+
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
31
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { createContext as e, forwardRef as t, useContext as n, useId as r, useState as i } from "react";
|
|
2
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
3
|
+
// src/components/radio-group/radio-group.tsx
|
|
4
|
+
var o = e(null);
|
|
5
|
+
function s() {
|
|
6
|
+
let e = n(o);
|
|
7
|
+
if (!e) throw Error("RadioGroup.Item must be used inside RadioGroup.Root.");
|
|
8
|
+
return e;
|
|
9
|
+
}
|
|
10
|
+
var c = {
|
|
11
|
+
Root: t(function({ value: e, defaultValue: t, onValueChange: n, disabled: s = !1, required: c = !1, name: l, ...u }, d) {
|
|
12
|
+
let f = r(), [p, m] = i(t), h = e !== void 0;
|
|
13
|
+
function g(e) {
|
|
14
|
+
h || m(e), n?.(e);
|
|
15
|
+
}
|
|
16
|
+
return /* @__PURE__ */ a(o.Provider, {
|
|
17
|
+
value: {
|
|
18
|
+
name: l ?? f,
|
|
19
|
+
value: h ? e : p,
|
|
20
|
+
disabled: s,
|
|
21
|
+
required: c,
|
|
22
|
+
select: g
|
|
23
|
+
},
|
|
24
|
+
children: /* @__PURE__ */ a("div", {
|
|
25
|
+
...u,
|
|
26
|
+
ref: d,
|
|
27
|
+
role: "radiogroup",
|
|
28
|
+
"aria-required": c || void 0
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
}),
|
|
32
|
+
Item: t(function({ value: e, disabled: t, ...n }, r) {
|
|
33
|
+
let i = s();
|
|
34
|
+
return /* @__PURE__ */ a("input", {
|
|
35
|
+
...n,
|
|
36
|
+
ref: r,
|
|
37
|
+
type: "radio",
|
|
38
|
+
name: i.name,
|
|
39
|
+
value: e,
|
|
40
|
+
checked: i.value === e,
|
|
41
|
+
disabled: i.disabled || t,
|
|
42
|
+
required: i.required,
|
|
43
|
+
onChange: () => i.select(e)
|
|
44
|
+
});
|
|
45
|
+
})
|
|
46
|
+
};
|
|
47
|
+
export { c as RadioGroup };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "react";
|
|
2
|
+
export type SeparatorProps = Omit<HTMLAttributes<HTMLElement>, "role"> & {
|
|
3
|
+
/** Defaults to "horizontal". */
|
|
4
|
+
orientation?: "horizontal" | "vertical";
|
|
5
|
+
/**
|
|
6
|
+
* Set when the line is only visual and carries no meaning. Screen readers
|
|
7
|
+
* then ignore it.
|
|
8
|
+
*/
|
|
9
|
+
decorative?: boolean;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* A dividing line between content.
|
|
13
|
+
*
|
|
14
|
+
* A meaningful horizontal separator renders a native `<hr>`. A vertical or
|
|
15
|
+
* decorative one renders a `<div>`, because `<hr>` has no vertical form and
|
|
16
|
+
* cannot be made decorative. Editio draws nothing; you style the line.
|
|
17
|
+
*/
|
|
18
|
+
export declare function Separator({ orientation, decorative, ...props }: SeparatorProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
// src/components/separator/separator.tsx
|
|
3
|
+
function t({ orientation: t = "horizontal", decorative: n = !1, ...r }) {
|
|
4
|
+
return n ? /* @__PURE__ */ e("div", {
|
|
5
|
+
...r,
|
|
6
|
+
role: "none"
|
|
7
|
+
}) : t === "horizontal" ? /* @__PURE__ */ e("hr", { ...r }) : /* @__PURE__ */ e("div", {
|
|
8
|
+
...r,
|
|
9
|
+
role: "separator",
|
|
10
|
+
"aria-orientation": "vertical"
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
export { t as Separator };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type CheckboxProps } from "../checkbox/checkbox.js";
|
|
2
|
+
export type SwitchProps = Omit<CheckboxProps, "indeterminate" | "role">;
|
|
3
|
+
/**
|
|
4
|
+
* An on/off control. It is a native checkbox with `role="switch"`, which
|
|
5
|
+
* browsers and screen readers announce as "switch, on/off". Space toggles it.
|
|
6
|
+
*/
|
|
7
|
+
export declare const Switch: import("react").ForwardRefExoticComponent<SwitchProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { forwardRef as e } from "react";
|
|
2
|
+
import { Checkbox as t } from "../checkbox/checkbox.js";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
// src/components/switch/switch.tsx
|
|
5
|
+
var r = e(function(e, r) {
|
|
6
|
+
return /* @__PURE__ */ n(t, {
|
|
7
|
+
...e,
|
|
8
|
+
ref: r,
|
|
9
|
+
role: "switch"
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
export { r as Switch };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from "react";
|
|
2
|
+
export type TextareaProps = ComponentPropsWithoutRef<"textarea"> & {
|
|
3
|
+
/** Called with the new text. Use with `value` for controlled mode. */
|
|
4
|
+
onValueChange?: (value: string) => void;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* A native `<textarea>`.
|
|
8
|
+
*
|
|
9
|
+
* Controlled: pass `value` and `onValueChange`.
|
|
10
|
+
* Uncontrolled: pass `defaultValue` (or nothing).
|
|
11
|
+
*/
|
|
12
|
+
export declare const Textarea: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & {
|
|
13
|
+
/** Called with the new text. Use with `value` for controlled mode. */
|
|
14
|
+
onValueChange?: (value: string) => void;
|
|
15
|
+
} & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { forwardRef as e } from "react";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
// src/components/textarea/textarea.tsx
|
|
4
|
+
var n = e(function({ onValueChange: e, onChange: n, ...r }, i) {
|
|
5
|
+
function a(t) {
|
|
6
|
+
n?.(t), e?.(t.target.value);
|
|
7
|
+
}
|
|
8
|
+
return /* @__PURE__ */ t("textarea", {
|
|
9
|
+
...r,
|
|
10
|
+
ref: i,
|
|
11
|
+
onChange: a
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
export { n as Textarea };
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
Backgrounds. Put .ed-bg and data-bg="…" on any container. All of them are
|
|
3
|
+
CSS only: gradients, masks, one inline SVG noise. Children sit above.
|
|
4
|
+
Halftone fades use the contrast-threshold trick: a dot gradient averaged
|
|
5
|
+
with a tone gradient, then pushed to pure black or white. Where the tone is
|
|
6
|
+
dark the dots merge, where it is light they vanish.
|
|
7
|
+
========================================================================== */
|
|
8
|
+
|
|
9
|
+
/* @variant bg/base */
|
|
10
|
+
.ed-bg {
|
|
11
|
+
position: relative;
|
|
12
|
+
isolation: isolate;
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
background-color: var(--ed-paper);
|
|
15
|
+
color: var(--ed-ink);
|
|
16
|
+
}
|
|
17
|
+
.ed-bg::before,
|
|
18
|
+
.ed-bg::after { content: ""; position: absolute; z-index: -1; pointer-events: none; }
|
|
19
|
+
/* @end */
|
|
20
|
+
|
|
21
|
+
/* @variant bg/newsprint */
|
|
22
|
+
/* Warm stock with fibre grain and slightly aged edges. */
|
|
23
|
+
.ed-bg[data-bg="newsprint"]::before {
|
|
24
|
+
inset: 0;
|
|
25
|
+
background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
|
|
26
|
+
opacity: var(--ed-grain-opacity);
|
|
27
|
+
mix-blend-mode: var(--ed-grain-blend);
|
|
28
|
+
}
|
|
29
|
+
.ed-bg[data-bg="newsprint"]::after {
|
|
30
|
+
inset: 0;
|
|
31
|
+
background: radial-gradient(ellipse at center, transparent 55%, color-mix(in srgb, var(--ed-ink) 13%, transparent) 130%);
|
|
32
|
+
}
|
|
33
|
+
/* @end */
|
|
34
|
+
|
|
35
|
+
/* @variant bg/dots */
|
|
36
|
+
/* Even halftone screen. Size follows --ed-dot. */
|
|
37
|
+
.ed-bg[data-bg="dots"] {
|
|
38
|
+
background-image: radial-gradient(circle at center, color-mix(in srgb, var(--ed-ink) 38%, transparent) 0 1.35px, transparent 1.8px);
|
|
39
|
+
background-size: var(--ed-dot) var(--ed-dot);
|
|
40
|
+
}
|
|
41
|
+
/* @end */
|
|
42
|
+
|
|
43
|
+
/* @variant bg/fade */
|
|
44
|
+
/* Halftone gradient. Dots grow toward the dark end. --ed-angle sets direction. */
|
|
45
|
+
.ed-bg[data-bg="fade"]::before {
|
|
46
|
+
inset: 0;
|
|
47
|
+
background:
|
|
48
|
+
radial-gradient(circle at center, rgb(0 0 0 / 0.5) 0, rgb(255 255 255 / 0.5) 100%) 0 0 / var(--ed-dot) var(--ed-dot),
|
|
49
|
+
linear-gradient(var(--ed-angle, 180deg), #fff 8%, #242424 100%);
|
|
50
|
+
filter: contrast(26) invert(var(--ed-ht-invert, 0));
|
|
51
|
+
mix-blend-mode: var(--ed-ht-blend, multiply);
|
|
52
|
+
}
|
|
53
|
+
/* @end */
|
|
54
|
+
|
|
55
|
+
/* @variant bg/spot */
|
|
56
|
+
/* Duotone plate: accent colour with a black halftone vignette. */
|
|
57
|
+
.ed-bg[data-bg="spot"] { background-color: var(--ed-accent); color: var(--ed-on-accent); }
|
|
58
|
+
.ed-bg[data-bg="spot"]::before {
|
|
59
|
+
inset: 0;
|
|
60
|
+
background:
|
|
61
|
+
radial-gradient(circle at center, rgb(0 0 0 / 0.5) 0, rgb(255 255 255 / 0.5) 100%) 0 0 / var(--ed-dot) var(--ed-dot),
|
|
62
|
+
radial-gradient(circle at 55% 45%, #fff 0, #fff 12%, #181818 78%);
|
|
63
|
+
filter: contrast(26);
|
|
64
|
+
mix-blend-mode: multiply;
|
|
65
|
+
}
|
|
66
|
+
/* @end */
|
|
67
|
+
|
|
68
|
+
/* @variant bg/grid */
|
|
69
|
+
/* Layout guides: 12 columns over a 24px baseline. */
|
|
70
|
+
.ed-bg[data-bg="grid"] {
|
|
71
|
+
background-image:
|
|
72
|
+
repeating-linear-gradient(to bottom, transparent 0 calc(1.5rem - 1px), var(--ed-tint) calc(1.5rem - 1px) 1.5rem),
|
|
73
|
+
linear-gradient(90deg, var(--ed-accent-tint) 0 calc(100% - 1rem), transparent calc(100% - 1rem));
|
|
74
|
+
background-size: 100% 100%, calc((100% + 1rem) / 12) 100%;
|
|
75
|
+
background-repeat: no-repeat, repeat-x;
|
|
76
|
+
}
|
|
77
|
+
/* @end */
|
|
78
|
+
|
|
79
|
+
/* @variant bg/ledger */
|
|
80
|
+
/* Ruled ledger paper with a hot margin line. */
|
|
81
|
+
.ed-bg[data-bg="ledger"] {
|
|
82
|
+
background-image:
|
|
83
|
+
linear-gradient(90deg, transparent 4.5rem, var(--ed-hot) 4.5rem calc(4.5rem + 1.5px), transparent calc(4.5rem + 1.5px)),
|
|
84
|
+
repeating-linear-gradient(to bottom, transparent 0 calc(1.75rem - 1px), color-mix(in srgb, var(--ed-accent) 55%, transparent) calc(1.75rem - 1px) 1.75rem);
|
|
85
|
+
}
|
|
86
|
+
/* @end */
|
|
87
|
+
|
|
88
|
+
/* @variant bg/hatch */
|
|
89
|
+
/* Engraving hatch that thins out like shading on a woodcut. */
|
|
90
|
+
.ed-bg[data-bg="hatch"]::before {
|
|
91
|
+
inset: 0;
|
|
92
|
+
background: repeating-linear-gradient(45deg, var(--ed-ink) 0 1px, transparent 1px 6px);
|
|
93
|
+
-webkit-mask: linear-gradient(to top, #000 0%, transparent 88%);
|
|
94
|
+
mask: linear-gradient(to top, #000 0%, transparent 88%);
|
|
95
|
+
}
|
|
96
|
+
.ed-bg[data-bg="hatch"]::after {
|
|
97
|
+
inset: 0;
|
|
98
|
+
background: repeating-linear-gradient(-45deg, var(--ed-ink) 0 1px, transparent 1px 6px);
|
|
99
|
+
-webkit-mask: radial-gradient(ellipse at 100% 100%, #000 0%, transparent 60%);
|
|
100
|
+
mask: radial-gradient(ellipse at 100% 100%, #000 0%, transparent 60%);
|
|
101
|
+
}
|
|
102
|
+
/* @end */
|
|
103
|
+
|
|
104
|
+
/* @variant bg/registration */
|
|
105
|
+
/* Press sheet: crop marks and registration targets. */
|
|
106
|
+
.ed-bg[data-bg="registration"] {
|
|
107
|
+
background-image:
|
|
108
|
+
linear-gradient(var(--ed-ink) 0 0), linear-gradient(var(--ed-ink) 0 0),
|
|
109
|
+
linear-gradient(var(--ed-ink) 0 0), linear-gradient(var(--ed-ink) 0 0),
|
|
110
|
+
linear-gradient(var(--ed-ink) 0 0), linear-gradient(var(--ed-ink) 0 0),
|
|
111
|
+
linear-gradient(var(--ed-ink) 0 0), linear-gradient(var(--ed-ink) 0 0);
|
|
112
|
+
background-size: 18px 1px, 1px 18px, 18px 1px, 1px 18px, 18px 1px, 1px 18px, 18px 1px, 1px 18px;
|
|
113
|
+
background-position:
|
|
114
|
+
0 22px, 22px 0,
|
|
115
|
+
100% 22px, calc(100% - 22px) 0,
|
|
116
|
+
0 calc(100% - 22px), 22px 100%,
|
|
117
|
+
100% calc(100% - 22px), calc(100% - 22px) 100%;
|
|
118
|
+
background-repeat: no-repeat;
|
|
119
|
+
}
|
|
120
|
+
.ed-bg[data-bg="registration"]::before,
|
|
121
|
+
.ed-bg[data-bg="registration"]::after {
|
|
122
|
+
left: 50%;
|
|
123
|
+
width: 26px;
|
|
124
|
+
height: 26px;
|
|
125
|
+
transform: translateX(-50%);
|
|
126
|
+
background:
|
|
127
|
+
linear-gradient(var(--ed-ink) 0 0) 50% 50% / 100% 1px no-repeat,
|
|
128
|
+
linear-gradient(var(--ed-ink) 0 0) 50% 50% / 1px 100% no-repeat,
|
|
129
|
+
radial-gradient(circle, transparent 0 6px, var(--ed-ink) 6px 7px, transparent 7px);
|
|
130
|
+
}
|
|
131
|
+
.ed-bg[data-bg="registration"]::before { top: 8px; }
|
|
132
|
+
.ed-bg[data-bg="registration"]::after { bottom: 8px; }
|
|
133
|
+
/* @end */
|
|
134
|
+
|
|
135
|
+
/* @variant bg/cinema */
|
|
136
|
+
/* Letterboxed frame with a soft vignette and film grain. Pair with data-ed-theme="graphite". */
|
|
137
|
+
.ed-bg[data-bg="cinema"] {
|
|
138
|
+
background-color: #0c0c0c;
|
|
139
|
+
background-image:
|
|
140
|
+
url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E"),
|
|
141
|
+
radial-gradient(ellipse 78% 68% at 50% 46%, #2e2e2e 0%, #151515 55%, #080808 100%);
|
|
142
|
+
background-blend-mode: overlay, normal;
|
|
143
|
+
}
|
|
144
|
+
.ed-bg[data-bg="cinema"]::before,
|
|
145
|
+
.ed-bg[data-bg="cinema"]::after { left: 0; right: 0; height: 11%; background: #000; }
|
|
146
|
+
.ed-bg[data-bg="cinema"]::before { top: 0; }
|
|
147
|
+
.ed-bg[data-bg="cinema"]::after { bottom: 0; }
|
|
148
|
+
/* @end */
|
|
149
|
+
|
|
150
|
+
/* @variant bg/cmyk */
|
|
151
|
+
/* Four-colour screens printed slightly out of register. */
|
|
152
|
+
.ed-bg[data-bg="cmyk"]::before {
|
|
153
|
+
inset: 0;
|
|
154
|
+
background-image:
|
|
155
|
+
radial-gradient(circle at center, #00aeef 0 2px, transparent 2.5px),
|
|
156
|
+
radial-gradient(circle at center, #ec008c 0 2px, transparent 2.5px),
|
|
157
|
+
radial-gradient(circle at center, #ffe600 0 2px, transparent 2.5px);
|
|
158
|
+
background-size: 10px 10px;
|
|
159
|
+
background-position: 0 0, 3px 4px, 6px 1px;
|
|
160
|
+
background-blend-mode: multiply;
|
|
161
|
+
opacity: 0.75;
|
|
162
|
+
-webkit-mask: linear-gradient(115deg, #000 0%, transparent 70%);
|
|
163
|
+
mask: linear-gradient(115deg, #000 0%, transparent 70%);
|
|
164
|
+
}
|
|
165
|
+
/* @end */
|
|
166
|
+
|
|
167
|
+
/* @variant bg/columns */
|
|
168
|
+
/* Three newspaper columns under a heavy head rule. */
|
|
169
|
+
.ed-bg[data-bg="columns"] {
|
|
170
|
+
background-image:
|
|
171
|
+
linear-gradient(var(--ed-ink) 0 0),
|
|
172
|
+
linear-gradient(var(--ed-ink) 0 0),
|
|
173
|
+
linear-gradient(var(--ed-ink) 0 0);
|
|
174
|
+
background-size: 100% var(--ed-thick), var(--ed-hair) 100%, var(--ed-hair) 100%;
|
|
175
|
+
background-position: 0 0, 33.333% 0, 66.666% 0;
|
|
176
|
+
background-repeat: no-repeat;
|
|
177
|
+
}
|
|
178
|
+
/* @end */
|
|
179
|
+
|
|
180
|
+
/* @variant bg/halftone */
|
|
181
|
+
/* Any <img> becomes a duotone halftone with CSS alone: the dots are made from its
|
|
182
|
+
brightness. Tune with --ed-dot (cell size), --ed-ht-bright and --ed-ht-contrast.
|
|
183
|
+
Tone the plate with data-tone="paper" or "hot" on .ed-duo. */
|
|
184
|
+
.ed-duo { position: relative; isolation: isolate; overflow: hidden; background: var(--ed-accent); }
|
|
185
|
+
.ed-duo[data-tone="paper"] { background: var(--ed-paper-2); }
|
|
186
|
+
.ed-duo[data-tone="hot"] { background: var(--ed-hot); }
|
|
187
|
+
.ed-halftone { position: relative; margin: 0; background: #fff; filter: contrast(var(--ed-ht-contrast, 26)); mix-blend-mode: multiply; }
|
|
188
|
+
.ed-halftone img {
|
|
189
|
+
display: block;
|
|
190
|
+
width: 100%;
|
|
191
|
+
aspect-ratio: var(--ed-ratio, 4 / 3);
|
|
192
|
+
object-fit: cover;
|
|
193
|
+
filter: grayscale(1) contrast(1.15) brightness(var(--ed-ht-bright, 1));
|
|
194
|
+
}
|
|
195
|
+
.ed-halftone::after {
|
|
196
|
+
content: "";
|
|
197
|
+
position: absolute;
|
|
198
|
+
inset: 0;
|
|
199
|
+
background: radial-gradient(circle at center, rgb(0 0 0 / 0.5) 0, rgb(255 255 255 / 0.5) 100%) 0 0 / var(--ed-dot) var(--ed-dot);
|
|
200
|
+
}
|
|
201
|
+
/* @end */
|