Posts

This profile is from a federated server and may be incomplete. Browse more on the original instance.

css, to CSS
@css@front-end.social avatar

Using modern CSS features to create a custom range slider with a tooltip. There is no JS to update the values, it's pure CSS with minimal HTML 😎

Powered by Scroll Driven animation, Anchor positioning, @​property and more! 🤩

Demo: https://codepen.io/t_afif/full/JjqNEbZ via :codepen: @codepen

Online Version: https://css-tip.com/range-slider-tooltip/

It's Chrome only for the tooltip but the range slider works fine in all the browsers.

Showing two range slider with a tooltip containing the selected values. From the linked demo.

simevidas, (edited )
@simevidas@mastodon.social avatar

@css Not having a label is not the problem. The problem is using a <label> element without including a label. That’s confusing. The purpose of the <label> element is to include a label. There is no other reason why this element exists, so if you don’t have a label in the demo, don’t use <label>. Just remove it. Use a <span> if you need a wrapper element.

css,
@css@front-end.social avatar

The previous range slider was good but not good enough to me. Let's upgrade it with some motion!

Now the tooltip will follow your movement to get a more realistic effect. Still 100% CSS magic. No JS! 😎

Demo: https://codepen.io/t_afif/full/MWdmZPL via :codepen: @codepen

Showing two range sliders with tooltip. Overview from the linked demo

css, to CSS
@css@front-end.social avatar

🛑 STOP Scrolling!

It's time to learn something new in CSS. You are one click away from getting a cool demo. What are you waiting for?

👉 https://random.css-tip.com 👈

#CSS #HTML

jaandrle,
@jaandrle@fosstodon.org avatar

@css What about creating a mastodon bot like @randomMDN?

css, (edited )
@css@front-end.social avatar

@jaandrle
I prefer to manually share them because they don't have the same format and a random feature may break stuff.

css, to CSS
@css@front-end.social avatar

🎮 New CSS Game!

What about a CSS game that you can play with your keyboard? No, it's not a joke but a reality!

Play "Super CSS Mario", the first ever CSS-Only game playable using your keyboard. Have fun! 🤩

✅ 0% JavaScript
✅ 100% CSS Magic

Demo: https://codepen.io/t_afif/full/OJYbVWP via :codepen: @codepen

Record yourself and show me your best attempt (No screenshots & no cheating 😈)

It's a Chrome (or Edge) only. I repeat, it's a Chrome-only experience.

#CSS #HTML #game

Showing a demo of the CSS-only game linked in the post. A cool Mario game where you can collect gold coins using Keyboard.

css,
@css@front-end.social avatar

Ready for "Super CSS Mario II"? This time it's more challenging because you have to avoid some enemies 😬

0% JavaScript, 100% CSS magic & 100% addictive!

Demo: https://codepen.io/t_afif/full/JjqEdJv via :codepen: @codepen

Show me your best attempt 👇

#CSS #HTML

kizu,
@kizu@front-end.social avatar
css, to ai
@css@front-end.social avatar
css, to CSS
@css@front-end.social avatar

💡 CSS Tip!

One line of code that looks strange and confusing. You may think it's not even CSS but it will save you many times in the future!

It will make sure the width of your element is always an integer! No more decimal and rounding issues!

"width: auto" with an upgrade 😎

No browser support yet but you can test it on the latest Chrome with the experimental flag enabled: https://codepen.io/t_afif/pen/rNgLyJz

css, to CSS
@css@front-end.social avatar

I released a new (better) version of CSS Pattern 🥳

👉 https://css-pattern.com 👈

✅ A unique URL per pattern
✅ Controls to adjust the size & colors
✅ Easy navigation between the patterns
✅ Still One-click to get the CSS code

Enjoy more than 140 CSS-only background patterns! 🤩

It took me 4589 years to name all the patterns 😅 but If you find a better (cool) name for a specific pattern let me know 👇

Overview of the new version of css-pattern.com. Showing the home page with different patterns and a few examples where I am adjusting the colors and size.

css, to CSS
@css@front-end.social avatar

💡 CSS Tip!

Turn a simple input into single-digit inputs using a few lines of CSS. Useful for One-Time Password fields.
✅ No extra element (only one input element)
✅ Less than 15 CSS declarations
✅ Optimized with CSS variables

Demo: https://codepen.io/t_afif/full/XWwbMNO via :codepen: @codepen

Online Version: https://css-tip.com/single-digit-inputs/

Showing the result of the linked demo. A One-Time password field using a single input element.

css, to CSS
@css@front-end.social avatar

📝 New CSS Article!

After the "Ultimate Collection of CSS Shapes". It's time for "The Modern Guide for making CSS Shapes". 🤩

https://smashingmagazine.com/2024/05/modern-guide-making-css-shapes/ via @smashingmag

A huge compilation of many CSS Tricks I have been using since years in this guide. All the secrets for creating CSS shapes are there!

Enjoy reading my 100th CSS Article! 🥳

css, to CSS
@css@front-end.social avatar

💡 CSS Tip!

How much code is needed to create a Sparkle shape? ✨
Only one gradient and you can easily get the border-only variation.

Demo: https://codepen.io/t_afif/full/eYaYzxX via :codepen: @codepen

Online Version: https://css-tip.com/sparkle-shape/

Two sparkle shapes. The second one is a border-only variation.

css, to CSS
@css@front-end.social avatar

💡CSS Tip!

Using the new relative color syntax, you can easily extract the R,G,B channels of any color and use them as separate colors.

Useful when you want to do some color manipulation.

Online Version: https://css-tip.com/rgb-channels/

css,
@css@front-end.social avatar

You can do the same thing with a different syntax using the color() function.

In both cases, you can either use "none" or "0". "none" is equivalent to "0" but has a special behavior when color interpolation is in play.

css, to CSS
@css@front-end.social avatar

💡 CSS Tip!

To target the html element, you either use "html {}" or ":root {}" but thanks to CSS nesting you can simply use "& {}"

When used alone, the nesting selector will match the root element!

A one-character selector 🤯

⚠️ It has a lower specificity than html and :root

Online Version: https://css-tip.com/root-selector/

css,
@css@front-end.social avatar

@simevidas yes, it should be the same as if you used :where(html) {}.

css,
@css@front-end.social avatar
css, to CSS
@css@front-end.social avatar
css, to CSS
@css@front-end.social avatar
css, to CSS
@css@front-end.social avatar

💡 CSS Tip!

Use modern CSS to add a status indicator to your avatar using less than 10 CSS declarations and without extra elements.
✅ Only the image element
✅ No pseudo-element
✅ Transparent gap
✅ Optimized with CSS variables

Demo: https://codepen.io/t_afif/full/yLrWeQP via :codepen: @codepen

Online Version: https://css-tip.com/status-indicator/

three rounded images with a status indicator at the bottom right

css,
@css@front-end.social avatar

You can also have a nice hover effect

video/mp4

css,
@css@front-end.social avatar

We can easily change the position of the indicator by rearranging the margin/padding values.

Demo: https://codepen.io/t_afif/full/rNbgoyz via :codepen: @codepen

four images with status indicator

css, to CSS
@css@front-end.social avatar

I just finished my next #CSS article and it's a special one because it will be my 100th article! 🤯

A big piece with more than 6000 words 😬

It's by far the longest article I have ever wrote so I hope you will enjoy it 🤞

After 100 articles, I can say that writing is exhausting but satisfying 😅

https://css-articles.com/

geoff,
@geoff@front-end.social avatar

@css I think we hit 7,000 words at one point! It'll be great to get this out — you put a lot of heart into it.

css,
@css@front-end.social avatar

@geoff so let's 7000 words and "edited by Geoff" 😎

This will attract more people for sure!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • provamag3
  • thenastyranch
  • magazineikmin
  • InstantRegret
  • osvaldo12
  • cubers
  • rosin
  • Youngstown
  • slotface
  • Durango
  • everett
  • kavyap
  • khanakhh
  • DreamBathrooms
  • megavids
  • ngwrru68w68
  • Leos
  • modclub
  • cisconetworking
  • love
  • GTA5RPClips
  • ethstaker
  • mdbf
  • anitta
  • normalnudes
  • tester
  • tacticalgear
  • JUstTest
  • All magazines