<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Aleksei Mikhailov</title>
    <description>The latest articles on DEV Community by Aleksei Mikhailov (@plxel).</description>
    <link>https://dev.to/plxel</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F504936%2F59501b89-3234-4ef5-94af-a46828846b03.png</url>
      <title>DEV Community: Aleksei Mikhailov</title>
      <link>https://dev.to/plxel</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/plxel"/>
    <language>en</language>
    <item>
      <title>Creating an Apple on a Plate with CSS: A Delicious Journey 🍏</title>
      <dc:creator>Aleksei Mikhailov</dc:creator>
      <pubDate>Thu, 21 Mar 2024 14:35:51 +0000</pubDate>
      <link>https://dev.to/plxel/creating-an-apple-on-a-plate-with-css-a-delicious-journey-5b5c</link>
      <guid>https://dev.to/plxel/creating-an-apple-on-a-plate-with-css-a-delicious-journey-5b5c</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for DEV Challenge v24.03.20, CSS Art: Favorite Snack.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Inspiration
&lt;/h2&gt;

&lt;p&gt;How about boost of vitamins from super tasty green apple 🍏?&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/plxel/embed/ExJWwrV?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Journey
&lt;/h2&gt;

&lt;p&gt;Last time I draw something with CSS was several years ago, when I was doing freeCodeCamp CSS projects. So no hardcore, just apple 😃 Well, not just apple, apple on the plate!&lt;/p&gt;

&lt;p&gt;This is amazing how many things you can achieve using just &lt;code&gt;box-shadow&lt;/code&gt;s. But first things first:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Plate
&lt;/h3&gt;

&lt;p&gt;For plate I use 2 div elements - for inner side and outside side accordingly. I used &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/clip-path"&gt;clip-path&lt;/a&gt;  CSS property to cut part of div, which wents outisde of plate. Probably not the best way to do it, but that was the easy one, plus really rare using this property in the real life (the one on the job, of course), so why not to try.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Apple
&lt;/h3&gt;

&lt;p&gt;Apple was born as div with different &lt;code&gt;border-radius&lt;/code&gt; values in different corners - to create "not perfect" shape. &lt;/p&gt;

&lt;p&gt;Adjusting the &lt;code&gt;box-shadow&lt;/code&gt;s to nail that perfect 3D effect was like trying to season a dish to perfection—too little, and it's bland; too much, and it's overwhelming. After a culinary marathon of tweaking, I finally found the 'chef's kiss' moment where it all just clicked. Who knew CSS could feel like hosting a cooking show, with each shadow adjustment akin to adding just a pinch more salt?&lt;/p&gt;

&lt;p&gt;And of course I couldn't stop on this, every apple has depression (hole) around the stem. &lt;/p&gt;

&lt;p&gt;In case you like me not master of apples terminology:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The stem of an apple is the small, twig-like part that connects the apple to the tree. It's essentially the apple's lifeline, delivering nutrients from the tree as the apple grows. Once the apple is ripe and picked, the stem remains as a small, woody protrusion at the top of the fruit. It's a familiar sight that often symbolizes freshness and natural growth.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I tried different shapes, but end up with rounded rotated div, and of course with the help of &lt;code&gt;box-shadow&lt;/code&gt; I managed to make it more natural.&lt;/p&gt;

&lt;p&gt;After that I added stick, which is just brown div, to make it  more imperfect I used background gradient and CSS transform function &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/skew"&gt;skew&lt;/a&gt;. &lt;/p&gt;

&lt;h3&gt;
  
  
  3. Leaf
&lt;/h3&gt;

&lt;p&gt;To make leaf I used &lt;code&gt;linear-gradient&lt;/code&gt; for background, &lt;code&gt;skew&lt;/code&gt; function to change its shape, different &lt;code&gt;border-radius&lt;/code&gt; for different angles and of course &lt;code&gt;box-shadow&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;To make veins on the leaf I use several absolute positioned divs. With help of &lt;code&gt;skew&lt;/code&gt; function I was able to make veins pretty thin. &lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This is my first post here, hope you enjoyed it and learned some apple terminology together with me!&lt;/p&gt;

</description>
      <category>frontendchallenge</category>
      <category>devchallenge</category>
      <category>css</category>
    </item>
  </channel>
</rss>
