Skip to content
Putting technology to work.
Insights to guide decisions and action.

Search articles

Leveraging modern CSS native features in client web development — Reducing JS dependencies with @function and offset-path

Table of contents · 11 items

CSS-Tricks has published a series of articles on modern CSS native features such as @function, offset-path, and @custom-media. Capabilities that previously required JavaScript or preprocessors like Sass—such as value calculations, motion along a path, and shared media queries—can now be handled entirely with standard CSS features.

Meanwhile, client web development continues to face the recurring problem where “JavaScript is added for minor interactions and conditional logic, resulting in delivered websites that are bloated and easily broken.” Supporting client web development, we see this not as a matter of “whether you can build flashy features,” but as a design challenge of “ensuring the client or subsequent agency can maintain the site without breaking it after handover.” Connecting with the page speed covered in our Core Web Vitals Improvement Guide (GH Media), the modern production foundations covered in Corporate Website Revamps with Astro 6.4 (GH Media), and the native page transitions covered in Client Implementation of Cross-Document View Transitions (GH Media), this article organizes “modern CSS native adoption” into a client development service package.

Why modern CSS matters right now

DimensionJS / Sass dependency (traditional)Native CSS (2026)
Value reuseSass variables and mixins@function / Custom properties
Conditional logicControlled with JavaScript@function / if() style declarations
Path animationJS librariesoffset-path
Media queriesShared via Sass mixins@custom-media
Build dependencyPreprocessors requiredParsed directly by browsers
MaintainabilityHandover requires the full build environmentSelf-contained entirely in CSS

Because browsers can now natively parse advanced CSS, achieving “both expressive presentation and maintainability using CSS alone, without relying on JS and build tools,” has become a practical option in client development. This enables us to guarantee lightweight, resilient websites as our deliverables.

Three structural changes beneficial to custom development projects

Structure 1: Moving from animating with JS to animating with CSS

Injecting heavy JS for scroll-linked effects or path-based animations slows page loads and hurts SEO. In custom development, we move animations into CSS using features like offset-path to trim JS bundles and lighten page loads.

Structure 2: Moving from Sass-dependent setups to pure CSS

Relying on Sass mixins and variables requires handing over the entire build environment to the next team. In custom development, we bring logic into native CSS via @function and @custom-media, handing over sites in a state where they can be maintained without specialized build knowledge.

Structure 3: Moving from ad-hoc CSS to engineered CSS architectures

Ad-hoc CSS quickly bloats. In custom development, we centrally manage values and breakpoints using custom properties and @function to deliver designs resilient to change.

The 5 phases of modern CSS native adoption delivered in custom development

Phase 1: Current state audit (1 week)

  • Audit JS and CSS dependencies on existing sites
  • Measure performance (Core Web Vitals)
  • Confirm browser support requirements (no IE / modern browsers only)
  • Identify replacement candidates (animations, conditional logic, breakpoints)

Phase 2: Architecture and token organization (1 week)

  • Define design tokens using custom properties
  • Standardize breakpoints using @custom-media
  • Consolidate calculation logic into CSS using @function
  • Determine fallback strategy (legacy browsers)

Phase 3: Implementation and replacement (2–3 weeks)

  • Migrate JS animations to offset-path and related features
  • Replace Sass mixins and variables with native CSS
  • Remove unnecessary JS bundles
  • Perform phased replacement and regression testing

Phase 4: Validation and optimization (1 week)

  • Remeasure Core Web Vitals (quantify improvements)
  • Validate rendering across major browsers and devices
  • Test fallback behavior

Phase 5: Handover and maintenance (ongoing)

  • Prepare CSS architecture documentation (tokens / naming conventions)
  • Provide maintenance runbooks and update procedures
  • Conduct regular browser compatibility reviews

Standard technology stack set for custom development

LayerRecommended technologyAlternative
Design tokensCustom propertiesSass variables (migration source)
Calculations and logic@functioncalc() / JS
Breakpoints@custom-mediaSass mixin
Animationoffset-path / CSS animationJS libraries
BuildLightning CSS / minimal setupPostCSS
MeasurementLighthouse / Core Web VitalsWebPageTest

Which projects need this and which do not

Projects requiring thisLow-priority projects
Page speed directly drives business results (e-commerce / landing pages)Internal-only admin dashboards
Maintained later by clients or another agencyContinuously and fully maintained in-house
Slow due to bloated JSAlready sufficiently lightweight
Long-term corporate websitesShort-lived campaign landing pages
Modern browser baseline is acceptableLegacy browser support is strictly required

Six clauses to include in client contracts

ClauseDetailsWhat the client should verify
Browser compatibilitySupport scope and fallbacksFeasibility of dropping legacy environments
Performance targetsCore Web Vitals target metricsAgreement on measurement criteria
Scope of JS reductionClarification of replacement targetsVerification of feature parity
Design assetsDelivery of tokens and naming conventionsPrerequisites for internal client updates
HandoverDocumentation and runbooksMaintenance framework
Ongoing maintenanceBrowser support reviewsOperating costs

Client-side ROI estimate (assuming corporate website / page speed improvements)

ItemCurrent (excessive JS)Native modern CSS adoptionDifference
Page speedSlow with high drop-off ratesLightweight and fastImproved bounce rates
MaintainabilityDependent on build environmentsUpdatable with pure CSSReduced handover hours
SEO evaluationDisadvantaged in Core Web VitalsImproved metricsUplift in organic search traffic
Revision costsHigh due to individual dependenciesLow thanks to structured designReduced annual operational costs
Annual benefitCaptured business opportunities via lower bounce rates + continuous maintenance savings

Even with a reasonable upfront investment, dropping bounce rates by several percentage points through page speed gains provides ample justification.

Five common pitfalls

Pitfall 1: Omitting fallbacks

Cutting-edge features are ignored by older environments. Apply them progressively using techniques like @supports.

Pitfall 2: Trying to push everything into CSS

JavaScript remains better suited for complex interactions. Separate responsibilities based on role.

Pitfall 3: Postponing design token setup

Ad-hoc values will bloat code again. Define tokens upfront.

Pitfall 4: Claiming “it got lighter” without measuring

Subjective impressions are unreliable. Evaluate quantitatively using Core Web Vitals.

Pitfall 5: Failing to leave documentation

Without clear design intent, future updates will break things. Leaving naming conventions and update procedures is essential.

90-day action plan

WeekAction
Week 1CSS / JS dependency audit + baseline measurement
Week 2Token architecture + breakpoint consolidation
Week 3〜5JS-to-CSS migration + bundle size reduction
Week 6〜7Remeasurement + cross-browser testing
Week 8〜13Documentation completion + start of maintenance operations

Conclusion — Moving from loading up JS to delivering lightweight CSS

With the widespread adoption of modern native CSS features such as @function, offset-path, and @custom-media, styling presentation and logic can now be handled entirely within CSS. From our perspective supporting client web development, “modern CSS native adoption”reducing JS dependencies, designing around tokens, powering animations natively, and handing over code that can be maintained without build expertise—is our new flagship offering for delivering lightweight, resilient websites.

If you are looking to solve issues like “slow sites weighed down by heavy JS,” “fragile handed-over sites,” or “improving Core Web Vitals,” please feel free to reach out via our contact form.

Sources

Share this articleXFacebook
Kakeru Suzuki

Fascinated by the possibilities of technology, has had a deep interest in programming and digital art since student days

Turn this article's theme into your company's next step

Starting from what you want to achieve with your website.

We organize user goals, required features, and ongoing maintenance structures to determine the first steps in development and improvement.

  • Website objectives
  • Features and usability
  • Post-launch operations
Consult on web development and improvements

You can consult with us from the initial conceptual stage. Details from this article will be carried over to the inquiry form.

Receive the latest articles via email · Read the web production guide
Free download

Complete Guide to Web Production: Costs, Vendor Selection & Traffic Acquisition [2026 Edition]

We have compiled cost benchmarks, vendor selection criteria, and traffic acquisition strategies into a PDF.

The PDF and newsletter emails are currently in Japanese.

You will also be subscribed to our newsletter. You can unsubscribe at any time.