diff --git a/scss/_mixins.scss b/scss/_mixins.scss new file mode 100644 index 00000000..774c0a0e --- /dev/null +++ b/scss/_mixins.scss @@ -0,0 +1,16 @@ +@use "variables" as *; + +// Standard transition mixin +@mixin ease-transition($property: transform, $speed: $speed-medium, $easing: var(--ease-ease)) { + transition: $property $speed $easing; +} + +// Animation mixin +@mixin ease-animation($name, $duration: 1s, $easing: $ease-in-out, $iteration: infinite) { + animation: $name $duration $easing $iteration; +} + +// Timing function mixin +@mixin ease-timing($easing: $ease-in-out) { + animation-timing-function: $easing; +} diff --git a/scss/_variables.scss b/scss/_variables.scss new file mode 100644 index 00000000..53b8f59b --- /dev/null +++ b/scss/_variables.scss @@ -0,0 +1,15 @@ +// ============================================ +// EaseMotion-css — SCSS Animation Tokens +// Fixes #1116: DRY refactor of repetitive CSS +// ============================================ + +// Core easing curves (matching existing CSS vars) +$ease-ease: cubic-bezier(0.25, 0.1, 0.25, 1); +$ease-bounce: cubic-bezier(0.8, 0, 1, 1); +$ease-in-out: cubic-bezier(0, 0, 0.2, 1); +$ease-ping: cubic-bezier(0, 0, 0.2, 1); + +// Duration tokens (matching --ease-speed-* vars) +$speed-fast: var(--ease-speed-fast); +$speed-medium: var(--ease-speed-medium); +$speed-slow: var(--ease-speed-slow); diff --git a/submissions/vendor-prefixes/README.md b/submissions/vendor-prefixes/README.md new file mode 100644 index 00000000..59375f75 --- /dev/null +++ b/submissions/vendor-prefixes/README.md @@ -0,0 +1,14 @@ +# Vendor Prefixes for Cross-Browser Compatibility + +## What it does +Adds -webkit-, -moz-, and -o- vendor prefixes to animation, transform, and transition properties to ensure consistent rendering across all major browsers including older Safari and mobile browsers. + +## How to use +Add after easemotion.css: +\\\html + + +\\\ + +## Why it fits EaseMotion CSS +Fixes issue #1117 - ensures EaseMotion animations work correctly on WebKit-based browsers, Safari, and legacy mobile browsers. diff --git a/submissions/vendor-prefixes/demo.html b/submissions/vendor-prefixes/demo.html new file mode 100644 index 00000000..969e2597 --- /dev/null +++ b/submissions/vendor-prefixes/demo.html @@ -0,0 +1,21 @@ + + +
+ +Works on Chrome, Firefox, Safari, and legacy browsers.
+ + diff --git a/submissions/vendor-prefixes/style.css b/submissions/vendor-prefixes/style.css new file mode 100644 index 00000000..0ecb4924 --- /dev/null +++ b/submissions/vendor-prefixes/style.css @@ -0,0 +1,17 @@ +/* Vendor Prefixes for Cross-Browser Animation Compatibility (Issue #1117) */ + +/* Keyframe animations with vendor prefixes */ + +@keyframes ease-kf-fade-in { from { opacity: 0; } to { opacity: 1; } } + + +@keyframes ease-kf-fade-out { from { opacity: 1; } to { opacity: 0; } } + +/* Vendor-prefixed transform support */ +[class*='ease-'] { + animation-fill-mode: both; + + backface-visibility: hidden; + + transform: translateZ(0); +}