Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

13.2 KB
Raw Blame
@source "../../";

@plugin "tailwindcss-animate";
@plugin "@tailwindcss/typography";
@plugin "tailwind-scrollbar";
@plugin "tailwind-scrollbar-hide";

@custom-variant dark (&:is(.dark *));
@custom-variant tall (@media (min-height: 769px));
/* Hover applies where a pointer can hover and at >=768px (byte-identical to
   the old plain `&:hover` on desktop), so phones drop sticky tap highlights. */
@custom-variant hover {
  @media (hover: hover) {
    &:hover {
      @slot;
    }
  }
  @media (width >= 48rem) {
    &:hover {
      @slot;
    }
  }
}

/* A 44x44 tap target around a smaller control, drawn by ::after (use as
   `max-md:hit-area`). Sets position: relative, so not for absolutely
   positioned elements, and needs the element's ::after to be free. */
@utility hit-area {
  position: relative;
  &::after {
    content: "";
    position: absolute;
    inset: calc(max(0px, (44px - 100%) / 2) * -1);
  }
}

/* Safe-area padding (needs viewport-fit=cover on the viewport meta). */
@utility pb-safe {
  padding-bottom: env(safe-area-inset-bottom);
}

@utility pt-safe {
  padding-top: env(safe-area-inset-top);
}

@utility pb-safe-4 {
  padding-bottom: calc(env(safe-area-inset-bottom) + 1rem);
}

@utility bg-gradient-fade {
  background-image: linear-gradient(
    90deg,
    var(--tw-gradient-from) 0%,
    var(--tw-gradient-to) 40%
  );
}

/*
 * scroll-fade / scroll-fade-x — vendored from shadcn's tailwind.css
 * (https://ui.shadcn.com/docs/utils/scroll-fade). Put it on the element that
 * scrolls: the edge with more content fades, tracking scroll position via
 * scroll-driven animation (static fade on both edges without support).
 */
@property --scroll-fade-t {
  syntax: "<length-percentage>";
  inherits: false;
  initial-value: 0px;
}
@property --scroll-fade-b {
  syntax: "<length-percentage>";
  inherits: false;
  initial-value: 0px;
}
@property --scroll-fade-s {
  syntax: "<length-percentage>";
  inherits: false;
  initial-value: 0px;
}
@property --scroll-fade-e {
  syntax: "<length-percentage>";
  inherits: false;
  initial-value: 0px;
}

@theme inline {
  @keyframes scroll-fade-reveal-t {
    from {
      --scroll-fade-t: 0px;
    }
    to {
      --scroll-fade-t: var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)));
    }
  }
  @keyframes scroll-fade-reveal-b {
    from {
      --scroll-fade-b: var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)));
    }
    to {
      --scroll-fade-b: 0px;
    }
  }
  @keyframes scroll-fade-reveal-s {
    from {
      --scroll-fade-s: 0px;
    }
    to {
      --scroll-fade-s: var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)));
    }
  }
  @keyframes scroll-fade-reveal-e {
    from {
      --scroll-fade-e: var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)));
    }
    to {
      --scroll-fade-e: 0px;
    }
  }
}

@utility scroll-fade {
  mask-image: linear-gradient(
    to bottom,
    transparent 0,
    #000 var(--scroll-fade-t, 0px),
    #000 calc(100% - var(--scroll-fade-b, 0px)),
    transparent 100%
  );
  mask-repeat: no-repeat;

  @supports (animation-timeline: scroll()) {
    animation:
      scroll-fade-reveal-t 1ms ease-in-out,
      scroll-fade-reveal-b 1ms ease-in-out;
    animation-timeline: scroll(self y), scroll(self y);
    animation-range:
      0 calc(var(--spacing) * 24),
      calc(100% - calc(var(--spacing) * 24)) 100%;
    animation-fill-mode: both;
  }

  @supports not (animation-timeline: scroll()) {
    --scroll-fade-t: var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)));
    --scroll-fade-b: var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)));
  }
}

@utility scroll-fade-x {
  mask-image: linear-gradient(
    to right,
    transparent 0,
    #000 var(--scroll-fade-s, 0px),
    #000 calc(100% - var(--scroll-fade-e, 0px)),
    transparent 100%
  );
  mask-repeat: no-repeat;

  @supports (animation-timeline: scroll()) {
    animation:
      scroll-fade-reveal-s 1ms ease-in-out,
      scroll-fade-reveal-e 1ms ease-in-out;
    animation-timeline: scroll(self inline), scroll(self inline);
    animation-range:
      0 calc(var(--spacing) * 24),
      calc(100% - calc(var(--spacing) * 24)) 100%;
    animation-fill-mode: both;
  }

  @supports not (animation-timeline: scroll()) {
    --scroll-fade-s: var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)));
    --scroll-fade-e: var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)));
  }
}

@utility scroll-fade-* {
  --scroll-fade-size: calc(var(--spacing) * --value(integer));
}

/*
 * Restore v3 base defaults that changed in v4.
 * - border color: v4 uses currentColor, v3 used gray-200
 *   (we override with border-border in @layer base, so this is fine)
 * - button cursor: v4 uses default, restore pointer
 * - placeholder: v4 uses currentColor/50%, restore gray-400 equivalent
 * - ring: v4 default is 1px, restore 3px default
 */
@layer base {
  html,
  body {
    overscroll-behavior-y: none;
  }

  /* Reduced motion keeps the fades and drops the movement: the enter/exit
     utilities read these variables, so zoom and slide collapse to nothing. */
  @media (prefers-reduced-motion: reduce) {
    *,
    ::before,
    ::after {
      --tw-enter-scale: 1 !important;
      --tw-exit-scale: 1 !important;
      --tw-enter-translate-x: 0 !important;
      --tw-enter-translate-y: 0 !important;
      --tw-exit-translate-x: 0 !important;
      --tw-exit-translate-y: 0 !important;
    }
  }

  button:not(:disabled),
  [role="button"]:not(:disabled) {
    cursor: pointer;
  }

  input::placeholder,
  textarea::placeholder {
    color: #9ca3af;
  }

  .container {
    margin-inline: auto;
    padding-inline: 2rem;
  }
}

@theme inline {
  --color-border: hsl(var(--border));
  --color-input: hsl(var(--input));
  --color-ring: hsl(var(--ring));
  --color-background: hsl(var(--background));
  --color-foreground: hsl(var(--foreground));

  --color-active: hsl(var(--active));
  --color-active-foreground: hsl(var(--active-foreground));

  --color-primary: hsl(var(--primary));
  --color-primary-foreground: hsl(var(--primary-foreground));

  --color-secondary: hsl(var(--secondary));
  --color-secondary-foreground: hsl(var(--secondary-foreground));

  --color-destructive: hsl(var(--destructive));
  --color-destructive-foreground: hsl(var(--destructive-foreground));

  --color-muted: hsl(var(--muted));
  --color-muted-foreground: hsl(var(--muted-foreground));

  --color-accent: hsl(var(--accent));
  --color-accent-foreground: hsl(var(--accent-foreground));

  --color-popover: hsl(var(--popover));
  --color-popover-foreground: hsl(var(--popover-foreground));

  --color-card: hsl(var(--card));
  --color-card-foreground: hsl(var(--card-foreground));

  --color-success: hsl(var(--success));
  --color-success-foreground: hsl(var(--success-foreground));

  --color-sidebar: hsl(var(--sidebar-background));
  --color-sidebar-foreground: hsl(var(--sidebar-foreground));
  --color-sidebar-primary: hsl(var(--sidebar-primary));
  --color-sidebar-primary-foreground: hsl(var(--sidebar-primary-foreground));
  --color-sidebar-accent: hsl(var(--sidebar-accent));
  --color-sidebar-accent-foreground: hsl(var(--sidebar-accent-foreground));
  --color-sidebar-border: hsl(var(--sidebar-border));
  --color-sidebar-ring: hsl(var(--sidebar-ring));

  --radius-2xl: calc(var(--radius) + 8px);
  --radius-xl: calc(var(--radius) + 4px);
  --radius-lg: var(--radius);
  --radius-md: calc(var(--radius) - 2px);
  --radius-sm: calc(var(--radius) - 4px);

  /*
   * Shadow scale: restore v3 values so existing shadow-sm/shadow-md
   * classes produce the same visual output as before.
   * v4 shifted the scale down (v4 shadow-sm = v3 shadow-xs).
   */
  --shadow-xs: 0 1px var(--base-shadow-color, rgb(0 0 0 / 0.05));
  --shadow-sm: 0 1px 2px 0 var(--base-shadow-color, rgb(0 0 0 / 0.05));
  --shadow-DEFAULT: 0px 3px 6px -3px var(--base-shadow-color, rgb(0 0 0 / 0.1)),
    0px 2px 4px -2px var(--base-shadow-color, rgb(0 0 0 / 0.1)),
    0px 1px 2px -1px var(--base-shadow-color, rgb(0 0 0 / 0.1)),
    0px 1px 1px -1px var(--base-shadow-color, rgb(0 0 0 / 0.1)),
    0px 1px 0px -1px var(--base-shadow-color, rgb(0 0 0 / 0.1));
  --shadow-md: 0 4px 6px -1px var(--base-shadow-color, rgb(0 0 0 / 0.1)),
    0 2px 4px -2px var(--base-shadow-color, rgb(0 0 0 / 0.1));
  --shadow-lg: 0 10px 15px -3px var(--base-shadow-color, rgb(0 0 0 / 0.1)),
    0 4px 6px -4px var(--base-shadow-color, rgb(0 0 0 / 0.1));
  --shadow-xl: 0 20px 25px -5px var(--base-shadow-color, rgb(0 0 0 / 0.1)),
    0 8px 10px -6px var(--base-shadow-color, rgb(0 0 0 / 0.1));
  --shadow-2xl: 0 25px 50px -12px var(--base-shadow-color, rgb(0 0 0 / 0.25));
  --shadow-button: var(--button-shadow);
  --shadow-popover: var(--popover-shadow);
  --shadow-dropdown-item: var(--dropdown-item-shadow);
  --shadow-button-base: var(--button-base-shadow);
  --shadow-button-primary: var(--button-primary-shadow);
  --shadow-button-danger: var(--button-danger-shadow);
  --shadow-inset-image-border: inset 0px 0px 0px 1px var(--border-primary);
  --shadow-select-item: var(--tw-ring-offset-shadow, 0 0 #0000),
    var(--tw-ring-shadow, 0 0 #0000),
    inset 0px 1px 0px rgb(255 255 255 / 0.02),
    inset 0px 0px 0px 1px rgb(255 255 255 / 0.02),
    0px 1px 2px rgb(0 0 0 / 0.12), 0px 2px 4px rgb(0 0 0 / 0.08),
    0px 0px 0px 0.5px rgb(0 0 0 / 0.24);

  --text-xxs: 0.675rem;

  --font-sans: "Geist Variable", ui-sans-serif, system-ui, sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --font-mono: "Geist Mono Variable", ui-monospace, SFMono-Regular, Menlo,
    Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --font-headline: "Geist Variable", ui-sans-serif, system-ui, sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";

  --tracking-normal: -0.02em;

  --animate-accordion-down: accordion-down 0.2s ease-out;
  --animate-accordion-up: accordion-up 0.2s ease-out;

  /* ErrorBoundary (VOID//SYS) effects */
  --animate-scan: scan 6s linear infinite;
  --animate-flicker: flicker 1.6s steps(1, end) infinite;

  /* CarbonPulse loader: a band of light sweeps the mark bottom-left to top-right */
  --animate-carbon-sweep: carbon-sweep var(--carbon-pulse-duration, 2400ms)
    cubic-bezier(0.65, 0, 0.35, 1) infinite;

  --container-2xl: 1400px;
}


@keyframes accordion-down {
  from {
    height: 0;
  }
  to {
    height: var(--radix-accordion-content-height);
  }
}

@keyframes accordion-up {
  from {
    height: var(--radix-accordion-content-height);
  }
  to {
    height: 0;
  }
}

@keyframes dashflow {
  from {
    stroke-dashoffset: 20;
  }
  to {
    stroke-dashoffset: 0;
  }
}

/* CarbonPulse: the mask band travels from just beyond the bottom-left corner
   to just beyond the top-right, then rests off the mark before the next pass.
   82%/18% puts the band's resting spots just outside a square mark; 100%/0%
   left it off the mark for half the sweep. */
@keyframes carbon-sweep {
  0% {
    mask-position: 82% 18%;
    -webkit-mask-position: 82% 18%;
  }
  75%,
  100% {
    mask-position: 18% 82%;
    -webkit-mask-position: 18% 82%;
  }
}

/* ErrorBoundary (VOID//SYS) effects */
@keyframes scan {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(300%);
  }
}

@keyframes flicker {
  0%,
  18%,
  22%,
  25%,
  53%,
  57%,
  100% {
    opacity: 1;
  }
  20%,
  24%,
  55% {
    opacity: 0.25;
  }
}

/*
 * Full-screen document editor: the locked first block (see the `title` mode of
 * @carbon/react's Editor) reads as the page title — matching the old borderless
 * title input (text-2xl / md:text-3xl, font-semibold, tracking-tight).
 */
.has-document-title .ProseMirror > :first-child {
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-top: 0;
  margin-bottom: 0.75rem;
}

@media (min-width: 768px) {
  .has-document-title .ProseMirror > :first-child {
    font-size: 1.875rem;
    line-height: 2.25rem;
  }
}

/*
 * Phone presentation (< 768px), every app.
 * - Muted text gets a darker token in light mode to pass 4.5:1 on grey.
 * - `.truncate` always ends in an ellipsis, whatever text-wrap utility is set.
 */
@media (width < 48rem) {
  html:not(.dark) {
    --muted-foreground: 220 3.8% 42% !important;
  }

  /* `text-pretty` / `text-balance` (CardTitle, Heading) reset the wrap mode
     that `truncate` sets, so a truncated title wrapped instead of ending in "…". */
  .truncate {
    white-space: nowrap;
  }
}

/*
 * Stacked dialogs. Every dialog backdrop carries `data-backdrop`, and only the
 * top-most OPEN one paints: a modal opened over a modal or a drawer dims and
 * blurs the page and the dialog beneath it once, instead of once per layer.
 * DOM order is stacking order — Radix portals append to <body> as they open.
 * The covered backdrop fades out while the new one fades in, and back again
 * as it closes (a closing backdrop is `data-state=closed` and stops covering).
 * Unlayered, so it outranks the overlays' own background/blur utilities.
 */
[data-backdrop] {
  transition:
    background-color 150ms,
    -webkit-backdrop-filter 150ms,
    backdrop-filter 150ms;
}

body
  > [data-backdrop]:has(
    ~ [data-backdrop][data-state="open"],
    ~ * [data-backdrop][data-state="open"]
  ),
body
  > :has(
    ~ [data-backdrop][data-state="open"],
    ~ * [data-backdrop][data-state="open"]
  )
  [data-backdrop] {
  background-color: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}