Skip to content

Instantly share code, notes, and snippets.

@kobitoDevelopment
Created May 13, 2025 13:10
Show Gist options
  • Save kobitoDevelopment/0697fc07c7ac151c4af197573571a36a to your computer and use it in GitHub Desktop.
Save kobitoDevelopment/0697fc07c7ac151c4af197573571a36a to your computer and use it in GitHub Desktop.
.text {
--minSize: 16;
--maxSize: 32;
--minViewportWidth: 768;
--maxViewportWidth: 1440;
font-size: clamp(calc(var(--minSize) * 1px), calc((var(--minSize) * 1px) + (var(--maxSize) - var(--minSize)) * ((100vw - (var(--minViewportWidth) * 1px)) / (var(--maxViewportWidth) - var(--minViewportWidth)))), calc(var(--maxSize) * 1px));
}
<p class="text">テキスト</p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment