Discussion
Loading...

#Tag

Log in
  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Roni Rolle Laukkarinen boosted
Ana Tudor ๐Ÿฏ
Ana Tudor ๐Ÿฏ
@anatudor@mastodon.social  ยท  activity timestamp 3 months ago

I am begging you, please don't split your heading into two separate `h2` elements with an `img` in between just to have the image in between your heading words.

This is what subgrid was made for!

#CSS #layout #cssLayout #code #coding #web #dev #webDev #webDevelopment

HTML:

```
<!-- โŒ DON'T DO THIS ๐Ÿšซ -->
<section>
  <h2>Classic</h2>
  <img src='classic-bar.png' alt=''/>
  <h2>Flavour</h2>
</section>

<!-- โœ… DO THIS โœ… -->
<section>
  <h2>
    <span>Classic</span>
    <span>Flavour</span>
  </h2>
  <img src='classic-bar.png' alt='the classic chocolate bar'/>
</section>
```

CSS:

```
section, h2 { display: grid }

section { grid-template-rows: repeat(3, auto) }

h2 {
  grid-area: 1/ 1/ span 3;
  grid-template-rows: subgrid;
  
  span:last-child { grid-row: 3 }
}

img { grid-area: 2/ 1 }
```
HTML: ``` <!-- โŒ DON'T DO THIS ๐Ÿšซ --> <section> <h2>Classic</h2> <img src='classic-bar.png' alt=''/> <h2>Flavour</h2> </section> <!-- โœ… DO THIS โœ… --> <section> <h2> <span>Classic</span> <span>Flavour</span> </h2> <img src='classic-bar.png' alt='the classic chocolate bar'/> </section> ``` CSS: ``` section, h2 { display: grid } section { grid-template-rows: repeat(3, auto) } h2 { grid-area: 1/ 1/ span 3; grid-template-rows: subgrid; span:last-child { grid-row: 3 } } img { grid-area: 2/ 1 } ```
HTML: ``` <!-- โŒ DON'T DO THIS ๐Ÿšซ --> <section> <h2>Classic</h2> <img src='classic-bar.png' alt=''/> <h2>Flavour</h2> </section> <!-- โœ… DO THIS โœ… --> <section> <h2> <span>Classic</span> <span>Flavour</span> </h2> <img src='classic-bar.png' alt='the classic chocolate bar'/> </section> ``` CSS: ``` section, h2 { display: grid } section { grid-template-rows: repeat(3, auto) } h2 { grid-area: 1/ 1/ span 3; grid-template-rows: subgrid; span:last-child { grid-row: 3 } } img { grid-area: 2/ 1 } ```
  • Copy link
  • Flag this post
  • Block
Ana Tudor ๐Ÿฏ
Ana Tudor ๐Ÿฏ
@anatudor@mastodon.social  ยท  activity timestamp 3 months ago

I am begging you, please don't split your heading into two separate `h2` elements with an `img` in between just to have the image in between your heading words.

This is what subgrid was made for!

#CSS #layout #cssLayout #code #coding #web #dev #webDev #webDevelopment

HTML:

```
<!-- โŒ DON'T DO THIS ๐Ÿšซ -->
<section>
  <h2>Classic</h2>
  <img src='classic-bar.png' alt=''/>
  <h2>Flavour</h2>
</section>

<!-- โœ… DO THIS โœ… -->
<section>
  <h2>
    <span>Classic</span>
    <span>Flavour</span>
  </h2>
  <img src='classic-bar.png' alt='the classic chocolate bar'/>
</section>
```

CSS:

```
section, h2 { display: grid }

section { grid-template-rows: repeat(3, auto) }

h2 {
  grid-area: 1/ 1/ span 3;
  grid-template-rows: subgrid;
  
  span:last-child { grid-row: 3 }
}

img { grid-area: 2/ 1 }
```
HTML: ``` <!-- โŒ DON'T DO THIS ๐Ÿšซ --> <section> <h2>Classic</h2> <img src='classic-bar.png' alt=''/> <h2>Flavour</h2> </section> <!-- โœ… DO THIS โœ… --> <section> <h2> <span>Classic</span> <span>Flavour</span> </h2> <img src='classic-bar.png' alt='the classic chocolate bar'/> </section> ``` CSS: ``` section, h2 { display: grid } section { grid-template-rows: repeat(3, auto) } h2 { grid-area: 1/ 1/ span 3; grid-template-rows: subgrid; span:last-child { grid-row: 3 } } img { grid-area: 2/ 1 } ```
HTML: ``` <!-- โŒ DON'T DO THIS ๐Ÿšซ --> <section> <h2>Classic</h2> <img src='classic-bar.png' alt=''/> <h2>Flavour</h2> </section> <!-- โœ… DO THIS โœ… --> <section> <h2> <span>Classic</span> <span>Flavour</span> </h2> <img src='classic-bar.png' alt='the classic chocolate bar'/> </section> ``` CSS: ``` section, h2 { display: grid } section { grid-template-rows: repeat(3, auto) } h2 { grid-area: 1/ 1/ span 3; grid-template-rows: subgrid; span:last-child { grid-row: 3 } } img { grid-area: 2/ 1 } ```
  • Copy link
  • Flag this post
  • Block
Roni Rolle Laukkarinen boosted
Ana Tudor ๐Ÿฏ
Ana Tudor ๐Ÿฏ
@anatudor@mastodon.social  ยท  activity timestamp 3 months ago

I have a new article out!

Super Simple Full-Bleed & Breakout Styles
https://frontendmasters.com/blog/super-simple-full-bleed-breakout-styles/ - my take on an old problem using modern CSS solutions.

Using a spooky made up Halloween recipe to illustrate concepts.

PS @chriscoyier told me to be proud of it ๐Ÿ˜›

#CSS #cssLayout #cssGrid #cssVariables #containerQueries #containerQuery #code #web #webDev #webDevelopment #dev #coding #frontend #Halloween

Your browser does not support the video tag.
This video cannot be previewed
Open original
Recording of the desired layout for a post on a recipe blog at various viewports. The image illustrating the post is a full-bleed element, the warning is a breakout element and the header is a breakout element with a full-bleed background.
  • Copy link
  • Flag this post
  • Block
Ana Tudor ๐Ÿฏ
Ana Tudor ๐Ÿฏ
@anatudor@mastodon.social  ยท  activity timestamp 3 months ago

I have a new article out!

Super Simple Full-Bleed & Breakout Styles
https://frontendmasters.com/blog/super-simple-full-bleed-breakout-styles/ - my take on an old problem using modern CSS solutions.

Using a spooky made up Halloween recipe to illustrate concepts.

PS @chriscoyier told me to be proud of it ๐Ÿ˜›

#CSS #cssLayout #cssGrid #cssVariables #containerQueries #containerQuery #code #web #webDev #webDevelopment #dev #coding #frontend #Halloween

Your browser does not support the video tag.
This video cannot be previewed
Open original
Recording of the desired layout for a post on a recipe blog at various viewports. The image illustrating the post is a full-bleed element, the warning is a breakout element and the header is a breakout element with a full-bleed background.
  • Copy link
  • Flag this post
  • Block
Roni Rolle Laukkarinen boosted
Ana Tudor ๐Ÿฏ
Ana Tudor ๐Ÿฏ
@anatudor@mastodon.social  ยท  activity timestamp 5 months ago
#cssChallenge2025 How would you code this with:

โœจ 1 HTML element, no JS, no SVG
โœจ inner border interrupted by text box shape
โœจ responsive
โœจ text wraps depending on space
โœจ contenteditable
โœจ 1 image = the background one

(if you're Cheetah+ on Ko-fi/ Patreon, you know where to find the answer)

#CSS #cssLayout #code #coding #frontend #web #dev #webDev #webDevelopment

Your browser does not support the video tag.
This video cannot be previewed
Open original
Text that can wrap depending on available space in the bottom left corner of a card with padding. At the limit between the card's padding area and content area, there's an inner border interrupted in the bottom left corner by the text box. The text is contenteditable.
  • Copy link
  • Flag this post
  • Block
Ana Tudor ๐Ÿฏ
Ana Tudor ๐Ÿฏ
@anatudor@mastodon.social  ยท  activity timestamp 5 months ago
#cssChallenge2025 How would you code this with:

โœจ 1 HTML element, no JS, no SVG
โœจ inner border interrupted by text box shape
โœจ responsive
โœจ text wraps depending on space
โœจ contenteditable
โœจ 1 image = the background one

(if you're Cheetah+ on Ko-fi/ Patreon, you know where to find the answer)

#CSS #cssLayout #code #coding #frontend #web #dev #webDev #webDevelopment

Your browser does not support the video tag.
This video cannot be previewed
Open original
Text that can wrap depending on available space in the bottom left corner of a card with padding. At the limit between the card's padding area and content area, there's an inner border interrupted in the bottom left corner by the text box. The text is contenteditable.
  • Copy link
  • Flag this post
  • Block
Roni Rolle Laukkarinen boosted
Ana Tudor ๐Ÿฏ
Ana Tudor ๐Ÿฏ
@anatudor@mastodon.social  ยท  activity timestamp 7 months ago

2๏ธโƒฃ feColorMatrix: swap channels โ˜† interactive demo, adaptive layout - check it out on @codepenhttps://codepen.io/thebabydino/full/QWopRMK

An interactive, responsive demo illustrating how feColorMatrix can be used to swap channels. Another very special one.

#SVG #filter #svgFilter#JS #interactive #javascript #code #coding #frontend#CSS #web #dev #webDevelopment #webDev #cssGrid #cssLayout

Behind the demo https://mastodon.social/@anatudor/112242678457752295

Your browser does not support the video tag.
This video cannot be previewed
Open original
Demo illustrating the feColorMatrix used to swap two individual RGB channels. Offers multiple comparison and test image options. Viewport adaptive.
  • Copy link
  • Flag this post
  • Block
Ana Tudor ๐Ÿฏ
Ana Tudor ๐Ÿฏ
@anatudor@mastodon.social  ยท  activity timestamp 7 months ago

2๏ธโƒฃ feColorMatrix: swap channels โ˜† interactive demo, adaptive layout - check it out on @codepenhttps://codepen.io/thebabydino/full/QWopRMK

An interactive, responsive demo illustrating how feColorMatrix can be used to swap channels. Another very special one.

#SVG #filter #svgFilter#JS #interactive #javascript #code #coding #frontend#CSS #web #dev #webDevelopment #webDev #cssGrid #cssLayout

Behind the demo https://mastodon.social/@anatudor/112242678457752295

Your browser does not support the video tag.
This video cannot be previewed
Open original
Demo illustrating the feColorMatrix used to swap two individual RGB channels. Offers multiple comparison and test image options. Viewport adaptive.
  • Copy link
  • Flag this post
  • Block
Roni Rolle Laukkarinen boosted
Ana Tudor ๐Ÿฏ
Ana Tudor ๐Ÿฏ
@anatudor@mastodon.social  ยท  activity timestamp 7 months ago

If a grid has n columns, it has n - 1 gaps in between them. Enjoy this interactive @codepen demo illustrating the concept: https://codepen.io/thebabydino/pen/LEVqOpZ

#CSS #cssGrid #cssLayout #code #coding #web #dev #webDev #webDevelopment #frontend

Screenshot of linked demo. Shows items distributed on 5 columns, with 4 gaps highlighted between them.
Screenshot of linked demo. Shows items distributed on 5 columns, with 4 gaps highlighted between them.
Screenshot of linked demo. Shows items distributed on 5 columns, with 4 gaps highlighted between them.
  • Copy link
  • Flag this post
  • Block
Ana Tudor ๐Ÿฏ
Ana Tudor ๐Ÿฏ
@anatudor@mastodon.social  ยท  activity timestamp 7 months ago

If a grid has n columns, it has n - 1 gaps in between them. Enjoy this interactive @codepen demo illustrating the concept: https://codepen.io/thebabydino/pen/LEVqOpZ

#CSS #cssGrid #cssLayout #code #coding #web #dev #webDev #webDevelopment #frontend

Screenshot of linked demo. Shows items distributed on 5 columns, with 4 gaps highlighted between them.
Screenshot of linked demo. Shows items distributed on 5 columns, with 4 gaps highlighted between them.
Screenshot of linked demo. Shows items distributed on 5 columns, with 4 gaps highlighted between them.
  • Copy link
  • Flag this post
  • Block

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About ยท Code of conduct ยท Privacy ยท Users ยท Instances
Bonfire social ยท 1.0.2-alpha.7 no JS en
Automatic federation enabled
Log in
  • Explore
  • About
  • Members
  • Code of Conduct