grant.codes

Jump to menu
  • About
  • Contact
  • Projects
  • Updates
  • More...Likes
  • Photos
  • Galleries
  • Replies
πŸ‘ˆπŸ•ΈπŸ’πŸ‘‰

Liked https://front-end.social/@argyleink/113834229298080017

Adam Argyle (@[email protected])

Posted Permalink
Liked 7 months ago

Liked https://cartosvg.com

Examples

CartoSVG uses SVG elements, which are interactive by nature.

The maps are given depth through filters and rich styling possibilities.

Just copy / paste the exported file into your HTML, and you're done!

The final file size is made as small as possible using diverse optimization techniques, and compresses well.

Here follows 4 examples built with CartoSVG. This entire page weights 470Ko, ~110 gzipped.

La Bella Italia

See the standalone example in the app for more information

Mercator projection

See the standalone example in the app for more information

USA Elections

See the standalone example in the app for more information

PoliticalpartyLight DemocratDemocratHeavy DemocratLight RepublicanRepublicanUndecided

Ukraine population

See the standalone example in the app for more information

Posted Permalink
Liked 7 months ago

Liked https://www.mshr.app

CSS mesh gradients

A collection of 732 vanilla CSS mesh gradients free for you to use in any of your projects. Browse our generated meshes or create your own custom mesh with our App.

Posted Permalink
Liked 7 months ago

Liked https://developer.chrome.com/docs/css-ui/css-field-sizing

CSS field-sizing | Chrome for Developers

Stay organized with collections

Save and categorize content based on your preferences.

One line of code for auto sizing elements with editable content.

Without field-sizing, to create a well-sized input field you had to either guess at an average size of a text field input or use JavaScript to count characters and increase the element height or width as the user entered text. In other words, it wasn't easy, and it was error prone when trying to follow the content that a user had entered into an input.

With field-sizing, you need one line of CSS to enable sizing based on the content. This content based sizing style also works for more than a textarea!

textarea, select, input {
 field-sizing: content;
}

Browser Support

  • Chrome: 123. 123
  • Edge: 123. 123
  • Firefox: not supported. x
  • Safari: not supported. x

Source

Specification | Explainer

Like short form videos?

Wes Bos and Jhey each have a great video on Twitter introducing you to field-sizing.

Which elements are affected by field-sizing?

Here is a list of <form> elements that field-sizing works on, with a summary of the effects it has on each.

<textarea>

The input collapses down to a min-inline-size or to fit the placeholder.

As users type, the input grows in the inline direction until it reaches a maximum inline size, at which point text will wrap and the block size of the input grows to fit the new line.

<select> and <select multiple>

The select element shrinks to fit the selected option.

A select with the multiple attribute grows to fit the widest option and to be as tall as needed to fit the number of options.

<input type="text">, <input type="email"> and <input type="number">

The input collapses down to a min-inline-size or to fit the placeholder.

As users type, the input grows in the inline direction until it reaches a max-inline-size, at which point overflow clips the input value.

<input type="file">

The input collapses down to the button and the prefilled filename text.

Upon uploading a file, the input becomes as wide as the button plus the filename text.

Seeing, testing, and comparing results

Here is an interactive and minimal example of the before and after behaviors of each form element, as affected by field-sizing.

Try it on Codepen

Looking closer

When using a [placeholder], the placeholder becomes the content. This was mentioned previously but called out here, as it is important to know when styling a form. A long or short placeholder will change the intrinsic size of inputs with field-sizing: content.

Try it on Codepen

Empty and overflowing style handling

Using field-sizing does mean you have to do some additional work. Ahmad Shadeed calls it "defensive CSS," where the goal is not necessarily to spell out exactly how something should behave or look, rather to protect it from getting into an undesirable visual state. Previously, inputs had a fair amount of fixed sizes, but after applying field-sizing: content, the inputs can become much too small or much too large.

The following styles are a good starting point. They help the elements not collapse into too small of a box and also, in the case of textarea, not grow too large.

textarea {
 min-block-size: 3.5rlh;
 min-inline-size: 20ch;
 max-inline-size: 50ch;
} select {
 min-inline-size: 5ch;
 min-block-size: 1.5lh;
} input {
 min-inline-size: 7ch;
}

This CSS uses relative units for the sizing. The new lh unit is perfect for the block sizes and ch works well for the inline sizes.

What is the default value of field-sizing?

The default value of field-sizing is fixed, and it only accepts the two values of fixed or content.

Posted Permalink
Liked 7 months ago

Liked https://toot.cafe/@tomayac/113446179350621117

Thomas Steiner :chrome

Posted Permalink
Liked 9 months ago

Liked https://front-end.social/@zeldman/113396308709565733

zeldman (@[email protected])

Posted Permalink
Liked 9 months ago

Liked https://smarthomescene.com/diy/diy-the-smallest-bluetooth-proxy-with-esp32-c3-supermini/

Liked 9 months ago

Liked https://floss.social/@downey/113387242711741163

Michael Downey =οΏ½ (@[email protected])

Posted Permalink
Liked 9 months ago

Liked https://www.nytimes.com/2024/10/17/climate/carbon-fires-forests-global-warming.html#commentsContainer

Liked 10 months ago

Liked https://www.jvt.me/posts/2024/10/15/slashes/?utm_medium=rss&utm_source=rss

Liked 10 months ago
NewerOlder
EmailInstagramGithub

Grant Richmond
grant.codes[email protected]