Add landing page for kjol, documentation
This commit is contained in:
@@ -72,7 +72,7 @@ var toastContainerPositions = map[ToastPosition]string{
|
||||
ToastBottomCenter: "bottom-4 left-1/2 -translate-x-1/2 flex-col-reverse",
|
||||
}
|
||||
|
||||
const toastBase = "relative overflow-hidden rounded-default shadow-lg border border-neutral-200 border-l-4 bg-white min-w-72 max-w-md transition-[opacity,transform] duration-150 ease-out"
|
||||
const toastBase = "relative overflow-hidden rounded-default shadow-lg border border-line border-l-4 bg-surface min-w-72 max-w-md transition-[opacity,transform] duration-150 ease-out"
|
||||
|
||||
var toastTypeBorder = map[ToastType]string{
|
||||
ToastSuccess: "border-l-green-700",
|
||||
@@ -84,9 +84,9 @@ var toastTypeBorder = map[ToastType]string{
|
||||
|
||||
var toastIconColor = map[ToastType]string{
|
||||
ToastSuccess: "text-green-600",
|
||||
ToastError: "text-red-600",
|
||||
ToastError: "text-red-600 dark:text-red-400",
|
||||
ToastWarning: "text-yellow-600",
|
||||
ToastInfo: "text-sky-700",
|
||||
ToastInfo: "text-sky-700 dark:text-sky-400",
|
||||
ToastGeneric: "",
|
||||
}
|
||||
|
||||
@@ -108,10 +108,10 @@ func ToastItem(t Toast, onDismiss func(string), progressRef *vdom.Ref) *vdom.VNo
|
||||
if icon != "" {
|
||||
row = append(row, Icon(icon, 20, cx("shrink-0 mt-0.5", toastIconColor[typ])))
|
||||
}
|
||||
row = append(row, vdom.Div(vdom.Attr("class", "flex-1 text-sm text-neutral-800"), vdom.Text(t.Message)))
|
||||
row = append(row, vdom.Div(vdom.Attr("class", "flex-1 text-sm text-ink"), vdom.Text(t.Message)))
|
||||
if t.Dismissible {
|
||||
dismiss := []vdom.Mod{
|
||||
vdom.Attr("class", "shrink-0 cursor-pointer text-neutral-400 hover:text-neutral-600 bg-transparent border-0 p-0 transition-colors"),
|
||||
vdom.Attr("class", "shrink-0 cursor-pointer text-ink-faint hover:text-ink-soft bg-transparent border-0 p-0 transition-colors"),
|
||||
vdom.Attr("aria-label", "Dismiss"),
|
||||
}
|
||||
if onDismiss != nil {
|
||||
@@ -133,13 +133,13 @@ func ToastItem(t Toast, onDismiss func(string), progressRef *vdom.Ref) *vdom.VNo
|
||||
// string on every render is what stops the reconciler's attribute diff from
|
||||
// resetting it back to 100% mid-countdown.
|
||||
bar := []vdom.Mod{
|
||||
vdom.Attr("class", "h-full bg-neutral-300"),
|
||||
vdom.Attr("class", "h-full bg-surface-strong"),
|
||||
vdom.Attr("style", "width:100%"),
|
||||
}
|
||||
if progressRef != nil {
|
||||
bar = append(bar, vdom.WithRef(progressRef))
|
||||
}
|
||||
mods = append(mods, vdom.Div(vdom.Attr("class", "h-1 w-full bg-neutral-100"),
|
||||
mods = append(mods, vdom.Div(vdom.Attr("class", "h-1 w-full bg-surface-raised"),
|
||||
vdom.Div(bar...),
|
||||
))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user