@css@front-end.social
@css@front-end.social avatar

css

@css@front-end.social

A lot of ๐—–๐—ฆ๐—ฆ stuff by ๐—ง๐—ฒ๐—บ๐—ฎ๐—ป๐—ถ ๐—”๐—ณ๐—ถ๐—ณ

๐Ÿ† https://css-challenges.com
โš™๏ธ https://css-generators.com
๐Ÿ“ https://css-articles.com
๐Ÿ’ซ https://css-loaders.com
๐ŸŽจ https://css-pattern.com
๐Ÿงฉ https://css-shape.com
๐Ÿ’ก https://css-tip.com
โœจ https://css-only.art
๐ŸŽฎ https://css-games.com
โ“ https://css-quizzes.com

I verified myself because I know I am a real person. You can trust me, I know who I am.

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

๐Ÿ’ก 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 #HTML

jkjustjoshing, to CSS
@jkjustjoshing@fosstodon.org avatar

Is there ever a time when this

width: 100%;
max-width: 480px;

behaves differently than this?

width: 480px;
max-width: 100%;

css,
@css@front-end.social avatar

@collinsworth @jkjustjoshing

I would say it depends on the percentage reference. In some cases, we cannot resolve the percentage so the 100% will fall to auto and you can see a different behavior.

Ex: https://codepen.io/t_afif/pen/eYazBrQ/80d9ae23ca3a84872ba15ab53e739fbb

danrot, to webdev
@danrot@mastodon.social avatar

I am sincerely wondering how hard it is to style a checkbox using . I'd be happy with just aligning them with a label, but this already seems to be asking for a lot. And most answers I find online are already outdated...

But hey, if you know more than I do let me know ๐Ÿ™‚

css,
@css@front-end.social avatar

@danrot I wrote a small tutorial on how to create simple and also more complex design for checkbox

https://verpex.com/blog/website-tips/how-to-style-checkbox-and-radio-buttons-using-css

chriscoyier, to random
@chriscoyier@front-end.social avatar

Assuming the premise that us CSS developers aren't reaching for container queries as much as well all thought we would is true...

Why do you think that is?

css,
@css@front-end.social avatar

@mattwilcox @matuzo @chriscoyier
not only stacking context but also containing block for absolute and fixed elements and it's always a "bad surprise" when you discover it.

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.

moh_kohn, to CSS
@moh_kohn@mastodon.scot avatar

Can I detect clamp support using @supports? #css

css,
@css@front-end.social avatar

@moh_kohn

@supports (opacity: clamp(0,0,0)) {} ?

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.

yuanchuan, to CSS
@yuanchuan@vis.social avatar

Chrome has a different behaviour from FF and Safari.

They used be the same. I'm not sure if the spec changes or Chrome has a bug in recent releases

https://codepen.io/yuanchuan/pen/bGydpjP

#CSS #grid #aspectratio

Source code grid { display: grid; width: 600px; height: 200px; background: #f0f0f0; grid-template-columns: repeat(10, 1fr); } grid > div { border: 2px solid #000; width: 50%; aspect-ratio: 1; }

css,
@css@front-end.social avatar

@yuanchuan I think you have to disable the stretch alignment (align-items: start)

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 #HTML #web

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 #HTML

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 #HTML

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

@J12t overflow: auto can also fix your issue.

ben, to random
@ben@m.benui.ca avatar

Stack Overflow announced that they are partnering with OpenAI, so I tried to delete my highest-rated answers.

Stack Overflow does not let you delete questions that have accepted answers and many upvotes because it would remove knowledge from the community.

So instead I changed my highest-rated answers to a protest message.

Within an hour mods had changed the questions back and suspended my account for 7 days.

Diff view of a stack overflow question showing it being changed from the original text to a protest message, then being changed back again by a mod. Protest text reads: Why does OpenAI get to profit from our work? I have removed this question in protest of Stack Overflow's decision to partner with OpenAI. This move steals the labour of everyone who contributed to Stack Overflow with no way to opt-out. OpenAI has a history of flooding the web with inaccurate information and have explicitly stated that they will never pay creators for their work.

css,
@css@front-end.social avatar

@ben I think in the end you will lose more than you will win because the only thing that can happen is the dissociation of the content from your name which is unfortunate because they will keep your content but no one will know it' was yours

tixie, to CSS
@tixie@guerilla.studio avatar

round(), mod(), sign(), abs()CSS functions aren't in Chromium based browsers yet (only on Firefox and Safari) ๐Ÿ˜ญ
#WhyWeCan'tHaveNiceThings

https://caniuse.com/mdn-css_types_round
https://caniuse.com/mdn-css_types_mod
https://caniuse.com/mdn-css_types_sign
https://caniuse.com/mdn-css_types_abs

Soโ€ฆ do you know if there ways to add some JS "polyfilling" (?) those functions to be able to use them in prototypes/technical demos. To allow everyone to be able to display them correctly no matter their browsers instead of just displaying a "only works on recent Firefox and Safari" banner?

#CSS #CSSPolyfill #JavaScript

css,
@css@front-end.social avatar

@tixie Some of them can be implemented with supported features

https://css-tricks.com/using-absolute-value-sign-rounding-and-modulo-in-css-today/

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 #HTML

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
andybond, to random
@andybond@mastodon.social avatar

I now mark the books Iโ€™m currently reading with a ribbon on https://andy.bond/now!

Really cool stuff by @css โค๏ธ

css,
@css@front-end.social avatar

@andybond nice little touch ๐Ÿ‘

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/

#CSS #HTML

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

#CSS #html

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

#CSS #HTML

four images with status indicator

dansays, to CSS
@dansays@mastodon.social avatar

#CSS nerds, I need your help with a stupid layout problem!

css,
@css@front-end.social avatar

@dansays You cannot do this. Even with hacks and workaround it's very difficult

https://github.com/w3c/csswg-drafts/issues/191

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