×

HubSpot Guide to CSS Timing

HubSpot Guide to CSS Animation Timing Functions

Designers and developers who build on HubSpot often want animations that feel polished, professional, and fast. To achieve that, you must understand CSS animation timing functions, the property that controls how motion accelerates and decelerates over time.

This guide walks through the core timing functions, how they behave in practice, and how to apply them to create smooth, accessible animations in any front-end project.

What Is an Animation Timing Function in HubSpot Projects?

When you animate elements on a page, the browser moves them from a starting state to an ending state. The animation timing function defines how that movement progresses along the timeline.

Instead of moving at a constant speed, elements can speed up, slow down, or follow a fully custom curve based on your design needs.

  • Used with transition-timing-function for transitions
  • Used with animation-timing-function for keyframe animations
  • Controls motion feeling: soft, snappy, natural, or mechanical

If you want animations on a HubSpot-powered site to feel premium and intentional, choosing the right timing function matters as much as choosing the right property to animate.

Core Timing Function Values Used in HubSpot Themes

Most front-end work, whether inside or outside HubSpot templates, relies on a handful of core keywords. Each one maps to a cubic-bezier curve under the hood.

linear

linear moves at a constant rate from start to finish. There is no acceleration or deceleration.

transition: transform 300ms linear;
  • Best for mechanical or loading indicators
  • Feels very artificial for interface elements
  • Avoid for large movement of UI components

ease

ease is the default timing for many browsers. It starts quickly, then slows near the end.

transition: opacity 250ms ease;
  • Good general-purpose option
  • Works well for fades and small movements
  • Less ideal for snappy, modern UI micro-interactions

ease-in

ease-in starts slowly and accelerates toward the end.

transition: transform 300ms ease-in;
  • Feels like motion “ramping up”
  • Good for elements entering a scene from off-screen
  • Can feel abrupt when the animation ends

ease-out

ease-out starts fast and slows before it finishes.

transition: transform 200ms ease-out;
  • Ideal for hover states and subtle micro-interactions
  • Common choice in modern web apps and HubSpot modules
  • Gives users time to perceive the final state

ease-in-out

ease-in-out combines both behaviors, starting and ending slowly with faster motion in the middle.

transition: transform 300ms ease-in-out;
  • Useful for larger movements
  • Feels natural when elements slide or move long distances
  • Good default for page-structure transitions

Understanding cubic-bezier in HubSpot Front-End Work

To fine-tune animation behavior in HubSpot or any other environment, you can use cubic-bezier(). This function exposes the underlying curve that defines velocity over time.

The syntax looks like this:

transition-timing-function: cubic-bezier(x1, y1, x2, y2);

Each pair of values sets a control point for the timing curve:

  • x1, x2: must be between 0 and 1 (time axis)
  • y1, y2: can be less than 0 or greater than 1 (speed axis)

By adjusting these values, you can simulate spring-like motion, strong easing, or very subtle changes, depending on your design system.

Common cubic-bezier Curves

Many popular animation patterns used in HubSpot layouts are just named shortcuts for specific curves. Below are some equivalents:

  • ease: cubic-bezier(0.25, 0.1, 0.25, 1)
  • ease-in: cubic-bezier(0.42, 0, 1, 1)
  • ease-out: cubic-bezier(0, 0, 0.58, 1)
  • ease-in-out: cubic-bezier(0.42, 0, 0.58, 1)

Once you understand these, you can design your own signature motion curve for a HubSpot theme or design system.

Step-by-Step: Applying Timing Functions in HubSpot Templates

The following practical steps show how to apply timing functions to transitions and animations commonly used on HubSpot pages.

1. Add a transition to a button

Start with a base button style, then add a transform and transition:

.hs-btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: #0052cc;
  color: #fff;
  border-radius: 4px;
  transition: transform 180ms ease-out, box-shadow 180ms ease-out;
}

.hs-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

This pattern works well in HubSpot CTA modules and custom coded sections.

2. Animate a card hover with a custom curve

Use cubic-bezier for a snappier motion:

.hs-card {
  transition: transform 220ms cubic-bezier(0.22, 0.61, 0.36, 1),
              box-shadow 220ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.hs-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
}

This timing curve accelerates quickly and eases gently, which feels refined on marketing pages built with HubSpot.

3. Use animation-timing-function in keyframes

For repeated or looping motion, apply timing inside a keyframe animation:

@keyframes float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
  100% { transform: translateY(0); }
}

.icon-float {
  animation: float 3s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

This type of motion works well for subtle illustrations in a HubSpot hero section, as long as you keep movement slow and non-distracting.

Best Practices for Timing Functions on HubSpot Sites

Good motion design supports content and conversion goals. Use these guidelines when configuring timing for a HubSpot-powered experience.

Match timing to interaction type

  • Micro-interactions (buttons, icons): 150–250ms, usually ease-out
  • Larger movements (modals, drawers): 250–400ms, ease-in-out
  • Background or decorative motion: 2–6s loops, subtle cubic-bezier curves

Keep HubSpot interfaces accessible

  • Respect prefers-reduced-motion in CSS
  • Avoid fast, repetitive motion that may cause discomfort
  • Ensure content remains usable with animations disabled
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

Test timing across devices

  • Check animations on mobile and desktop
  • Ensure performance remains smooth even on slower connections
  • Validate that motion supports, not blocks, user tasks inside HubSpot forms and modules

Advanced Resources for HubSpot Motion Design

To go deeper into animation timing and cubic-bezier curves beyond HubSpot, review the original reference material that inspired this guide at this article on CSS animation timing functions.

If you are planning a broader optimization project, including SEO and performance improvements for a HubSpot site, you can also explore expert consulting services from Consultevo.

Summary: Bringing Refined Motion to HubSpot Builds

Thoughtful timing functions give your animations personality and clarity. By understanding the core keywords, learning cubic-bezier curves, and applying best practices, you can craft motion that matches any HubSpot brand, from subtle product tours to bold marketing pages.

Start with ease-out for micro-interactions, use ease-in-out for larger movements, and then refine with custom cubic-bezier values once your motion language feels consistent and on-brand.

Need Help With Hubspot?

If you want expert help building, automating, or scaling your Hubspot , work with ConsultEvo, a team who has a decade of Hubspot experience.

Scale Hubspot

“`

Verified by MonsterInsights