Skip to content

Styles broken when using inlineStyleThreshold! #14110

Closed as duplicate
Closed as duplicate

Description

@timephy

Describe the bug

Hey, after a recent update I noticed that some styles set in component <style lang="postcss"> tags were not included in a build when using inlineStyleThreshold, although it works during dev❗

Example Component

<button class="flex max-w-full items-center justify-between rounded-full border p-2 pl-[14px] pr-3" {onclick}>
        <Icon data={question_circle} class="size-[18px] shrink-0" />
        <p class="grow truncate pl-[14px] pr-[12px] text-left">{text}</p>
        <Icon data={chevron_right} class="size-[14px] shrink-0" />
</button>

<style lang="postcss">
    button {
        @apply border-blue-050/10 hover:border-blue-150/15 active:border-blue-250/20;
        @apply bg-blue-000/10 hover:bg-blue-100/15 active:bg-blue-200/20;
        @apply text-blue-000 hover:text-blue-100 active:text-blue-200;
    }
</style>

How this turns out in a build (notice the blue color missing) ❗:

Image

How it should look and has worked for months now ✅:

Image

Svelte Config

import nodeAdapter from "@sveltejs/adapter-node"
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte"

const config = {
    // Consult https://kit.svelte.dev/docs/integrations#preprocessors
    // for more information about preprocessors
    preprocess: vitePreprocess(),

    kit: {
        adapter: nodeAdapter({
                out: "build-node",
                precompress: false,
            }),

        inlineStyleThreshold: 1024 * 1024, // 1MB

        alias: {
            $bindings: "../backend/target/bindings",
            $i18n: "src/i18n",
        },
    },
}

Reproduction

--

Logs

System Info

Progress: resolved 1, reused 0, downloaded 1, added 1, done

  System:
    OS: macOS 15.5
    CPU: (20) x64 Intel(R) Xeon(R) W-2150B CPU @ 3.00GHz
    Memory: 2.35 GB / 64.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 24.5.0 - /usr/local/bin/node
    Yarn: 1.22.11 - /usr/local/bin/yarn
    npm: 11.5.1 - /usr/local/bin/npm
    pnpm: 10.13.1 - /usr/local/bin/pnpm
    bun: 1.0.25 - /usr/local/bin/bun
  Browsers:
    Chrome: 138.0.7204.184
    Safari: 18.5
  npmPackages:
    @sveltejs/adapter-node: ^5.2.13 => 5.2.13 
    @sveltejs/adapter-static: ^3.0.8 => 3.0.8 
    @sveltejs/enhanced-img: ^0.6.1 => 0.6.1 
    @sveltejs/kit: 2.27.0 => 2.27.0 
    @sveltejs/vite-plugin-svelte: ^6.1.0 => 6.1.0 
    svelte: 5.37.3 => 5.37.3 
    vite: ^7.0.6 => 7.0.6

Severity

blocking an upgrade

Additional Information

No response

Activity

  1. timephy commented on Aug 5, 2025

    @timephy
    Author

    I wanted to add that this also happens with "standard CSS rules"! Now only with Tailwinds @apply.

  2. changed the title [-]`inlineStyleThreshold` does to not include component `<style lang="postcss">`[/-] [+]Styles broken when using `inlineStyleThreshold`![/+] on Aug 9, 2025
  3. teemingc commented on Aug 11, 2025

    @teemingc
    Member

    Please provide a reproduction in the form of a repository.

  4. teemingc commented on Aug 11, 2025

    @teemingc
    Member

    It might be better to continue the discussion in the duplicate issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions