Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Stylus Laravel Package

kylekatarnls/stylus

PHP implementation of the Stylus CSS preprocessor. Compile .styl stylesheets into plain CSS without a Node.js toolchain, using variables, mixins, nesting, and functions to keep styles maintainable in Laravel and other PHP projects.

Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • Pure-PHP compilation is architecturally attractive for a Laravel shop that wants zero Node/npm in CI or on shared hosting: the compiler becomes a Composer dependency, lives in vendor/, and can be invoked from an artisan command, a queued job, or a deploy script.
  • The fit is strongest where the asset pipeline is already PHP-centric (Blade, artisan, Envoyer/Deployer hooks) and weakest where the team has standardized on Vite + PostCSS, which is the modern Laravel default. This package predates that shift and does not participate in it.
  • It is a preprocessor, not an asset pipeline. It emits CSS — it does not do autoprefixing, minification, source maps, content hashing, or module bundling. Those remain separate concerns that must be solved in PHP or reintroduced via Node, which erodes the "no JavaScript dependency" value proposition.

Integration feasibility

  • Feasible as a timeboxed spike, not as a committed dependency. The advertised "drop-in Laravel integration" needs verification against the target Laravel major; a package last released 2019-01-16 was written against Laravel 5.x/6.x and PHP 7.x conventions, and package auto-discovery, service provider signatures, and config publishing have all moved since.
  • Compilation is a build-time operation, which keeps the blast radius small: if it fails, deploys fail loudly rather than breaking runtime traffic. That is the single biggest de-risking factor.
  • Language-level risk is high and cheap to test: PHP 8.1+ deprecations (dynamic properties, implicit nullable parameters), removed functions, and stricter type handling are the usual breakage points for 2019-era packages. A 30-minute composer require + compile-the-sample-corpus test answers this definitively.

Technical risk

  • Abandonment risk (critical). 12 stars, score 0.09, no release in ~7 years. There is no credible maintenance signal, no security response process, and no community to absorb bugs. Assume the team owns the source from day one.
  • Fidelity risk (high). A pure-PHP reimplementation of a JS language is a second implementation, and second implementations drift. Indentation-sensitive grammars, operator precedence, and expression evaluation are exactly where partial ports diverge. "Existing .styl files work as-is" is a marketing claim that must be proved file-by-file, not assumed.
  • Ecosystem risk (high, and not the package's fault). Stylus itself is a shrinking niche versus Sass and Tailwind/PostCSS. Adopting it locks the team into a preprocessor with a thinning talent pool, and the PHP port sits at the far end of that already-narrow branch.
  • Supply-chain risk (low-moderate). MIT license is permissive and unproblematic. The risk is not legal but practical: transitive dependencies of a 2019 package are likely stale, and there is no upstream to patch them.
  • Security risk (low). Compilation runs on trusted, repository-controlled stylesheets at build time. This changes materially if anyone compiles user-supplied .styl input, since @import resolution implies filesystem path handling.

Key questions

  1. Does it install and compile cleanly on our current PHP and Laravel versions, and what does the maintainer's issue tracker say about PHP 8?
  2. What is the actual output fidelity against reference Node Stylus on our stylesheets — is there a diff-able corpus we can compile both ways?
  3. Who owns this code if the upstream maintainer is unreachable — do we have an engineer willing to fork and patch, and is that costed?
  4. Is the "no Node" constraint a hard organizational requirement (shared hosting, security policy, air-gapped CI) or a preference? If it's a preference, this package has no case.
  5. Does the team already have Stylus expertise, or would we be adopting a niche language and an unmaintained port simultaneously?
  6. What is the exit path if we adopt and it breaks — how many files and how much rewrite to migrate to Sass?

Integration Approach

Stack fit

  • Good fit: Laravel monolith, Blade templates, artisan-driven deploys, no existing Node toolchain, small-to-medium stylesheet surface.
  • Poor fit: Vite/laravel-vite-plugin projects, teams on Tailwind or PostCSS, monorepos with a shared frontend build, or any environment where designers hand off .scss.
  • Pragmatic middle ground: use it as an isolated compiler invoked by a single artisan command or deploy hook, so the rest of the asset pipeline stays untouched and the dependency is trivially removable.

Migration path

  1. Inventory every .styl file and every Stylus feature in use (variables, mixins, nesting, operators, @import, conditionals, interpolation, built-in functions). Feature inventory, not file count, determines feasibility.
  2. Spike on a branch: install, wire the service provider or call the compiler directly, compile the corpus, and diff PHP output against Node Stylus output. Any non-trivial diff is a stop signal.
  3. Gate on PHP/Laravel compatibility before writing integration code — this is the cheapest possible kill point.
  4. If green, integrate at build time only, with committed generated CSS as the deploy artifact so production never depends on the compiler.
  5. If red, fall back to Node Stylus in a containerized build step (preserves the language, discards the "no Node" requirement) or migrate to Sass.

Compatibility

  • Verify against the exact PHP and Laravel versions in production, not the versions in the README. Test the oldest PHP you must support and the newest.
  • Expect to shim: config publishing, service provider registration, and possibly console command signatures.
  • Do not assume Stylus version parity. Pin the reference Node Stylus version used in your diff harness so fidelity comparisons are meaningful, and document which language features are unsupported.

Sequencing

  • Compatibility spike → fidelity spike → feature inventory → go/no-go decision → integration → CI wiring → documentation of the fork policy.
  • Do the compatibility and fidelity spikes in parallel and timebox both to a few days. The decision should be cheap; the commitment is expensive.
  • Never sequence this ahead of a broader frontend-tooling decision. Resolve "what is our asset pipeline" first; a preprocessor choice should follow from it, not lead it.

Operational Impact

Maintenance

  • Effectively unmaintained upstream. Budget for a vendored fork under team ownership from day one: fork to a private or org namespace, pin the version, and treat it as first-party code with a named owner.
  • Expect a recurring tax of a few engineer-days per year just to keep it green against PHP upgrades — and a larger, unpredictable spike whenever PHP makes a breaking change to language semantics.
  • Documentation debt is real: the team must write and own the "supported Stylus subset" reference, because upstream will not.

Support

  • No vendor, no SLA, no upstream security advisories. Internal support means whoever forked it.
  • Onboarding cost is doubled: new hires must learn a niche preprocessor and the quirks of a partial PHP port. Neither skill is transferable or commonly available.
  • Incident response is entirely internal; there is no community to escalate to.

Scaling

  • Compilation does not scale with traffic — it is a build-time cost — so runtime scaling is a non-issue. That is a genuine advantage.
  • Build-time scaling is a concern: pure-PHP parsing is materially slower than a mature native/JS implementation, and @import chains re-parse shared partials. For a large stylesheet tree this can add meaningful seconds to every deploy. Mitigate with output caching keyed on source hashes and by compiling only changed entry points.
  • Team scaling is the real constraint: the pool of engineers who can safely patch an indentation-sensitive parser port is approximately one or two people.

Failure modes

  • Silent miscompilation — the worst failure. Valid Stylus in, syntactically valid but semantically wrong CSS out, with no error. Deployed styling breaks subtly and is found by users. Mitigate with golden-file tests diffing against reference Stylus.
  • Hard break on PHP upgrade — deprecation notices become exceptions, and deploys stop. Loud and recoverable, but it lands mid-upgrade-cycle.
  • Unsupported-syntax cliff — a developer writes legitimate Stylus that the port does not implement; error messaging may be poor or the file may compile partially.
  • Dependency rot — transitive Composer packages go abandoned, blocking a framework upgrade. Resolved only by forking.
  • Bus factor of one — the internal owner leaves, and the fork becomes an unowned, undocumented build dependency.

Ramp-up

  • Fast for anyone who already knows Stylus syntax; the indentation-based grammar is pleasant and the feature set is small.
  • Slower than expected for everyone else, because the failure mode is divergence from expected Stylus behavior, not unfamiliarity with the language. Debugging means reasoning about a parser port, not reading docs.
  • Realistic ramp-up: half a day for a competent Laravel engineer to compile and ship a stylesheet; one to two weeks before they can diagnose a miscompilation; months before anyone is genuinely confident patching the parser.

TPM recommendation

Do not adopt for new work. A 2019-vintage, 12-star, effectively abandoned package with no release in seven years and a 0.09 score is a liability on the critical build path, and the "no Node" benefit is smaller than the ownership cost it creates. Sanction a short, timeboxed spike only if eliminating Node is a hard organizational constraint — and pre-commit to the exit path (Node Stylus in a container, or Sass migration) before writing any integration code. If the constraint is merely a preference, skip the spike and use Sass.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator