<?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: Ayush Kumar</title>
    <description>The latest articles on DEV Community by Ayush Kumar (@gruks).</description>
    <link>https://dev.to/gruks</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4160242%2F6b99e5ce-8773-48c3-8a16-07682a1155a9.jpg</url>
      <title>DEV Community: Ayush Kumar</title>
      <link>https://dev.to/gruks</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gruks"/>
    <language>en</language>
    <item>
      <title>PantryPal: A Private, Offline Kitchen Assistant Built for My Friend</title>
      <dc:creator>Ayush Kumar</dc:creator>
      <pubDate>Sun, 04 Oct 2026 10:35:35 +0000</pubDate>
      <link>https://dev.to/gruks/pantrypal-a-private-offline-kitchen-assistant-built-for-my-friend-b7e</link>
      <guid>https://dev.to/gruks/pantrypal-a-private-offline-kitchen-assistant-built-for-my-friend-b7e</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-weekend-2026-10-01"&gt;Hacktoberfest Weekend Challenge: Build for a Friend&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;I built PantryPal for a friend who lives in a flat, rarely has every ingredient required by a recipe, and wants to follow either a light-oil healthy diet or a high-protein carnivore diet.&lt;/p&gt;

&lt;p&gt;PantryPal starts with what my friend actually has:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;their dietary goals&lt;/li&gt;
&lt;li&gt;their available utensils&lt;/li&gt;
&lt;li&gt;their pantry inventory&lt;/li&gt;
&lt;li&gt;their calorie and protein targets&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It then recommends recipes that can realistically be cooked in their kitchen.&lt;/p&gt;

&lt;p&gt;The app also:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;scales ingredient quantities to the user's targets&lt;/li&gt;
&lt;li&gt;calculates calories, protein, carbohydrates, fat, fiber, vitamins and minerals&lt;/li&gt;
&lt;li&gt;identifies missing ingredients&lt;/li&gt;
&lt;li&gt;suggests substitutions&lt;/li&gt;
&lt;li&gt;rewrites cooking steps for available utensils&lt;/li&gt;
&lt;li&gt;creates a shopping list&lt;/li&gt;
&lt;li&gt;deducts ingredients after a meal is cooked&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;&lt;a href="https://drive.google.com/file/d/1T-YJsNJFU7i5XxI_YcIMQZgYWqPvczvp/view?usp=sharing" rel="noopener noreferrer"&gt;Video&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/gruks/HacktoberFest/tree/main/Week%201" rel="noopener noreferrer"&gt;PantryPal GitHub repository&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The project includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Python and Streamlit UI&lt;/li&gt;
&lt;li&gt;SQLite local storage&lt;/li&gt;
&lt;li&gt;JSON nutrition and recipe data&lt;/li&gt;
&lt;li&gt;deterministic nutrition and portion calculations&lt;/li&gt;
&lt;li&gt;Ollama integration&lt;/li&gt;
&lt;li&gt;unit tests for the core logic&lt;/li&gt;
&lt;li&gt;MIT license&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;PantryPal uses a hybrid design where deterministic code handles the parts that must be reliable, while the local language model handles the parts where language and taste judgment are useful.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;Responsibility&lt;/th&gt;
&lt;th&gt;Technology&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Code&lt;/td&gt;
&lt;td&gt;Filtering, scoring, scaling and nutrition math&lt;/td&gt;
&lt;td&gt;Python&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Local AI&lt;/td&gt;
&lt;td&gt;Ingredient substitutions and step rewrites&lt;/td&gt;
&lt;td&gt;Qwen3-VL 4B through Ollama&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Data&lt;/td&gt;
&lt;td&gt;Profile, pantry, recipes and nutrition&lt;/td&gt;
&lt;td&gt;SQLite and JSON&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;UI&lt;/td&gt;
&lt;td&gt;Kitchen assistant interface&lt;/td&gt;
&lt;td&gt;Streamlit&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The model does not calculate nutrition or invent arbitrary ingredients.&lt;/p&gt;

&lt;p&gt;The code first creates a constrained list of valid substitution candidates. Qwen3-VL then chooses from that list and explains the choice. The result is validated before it is shown to the user.&lt;/p&gt;

&lt;p&gt;The nutritional calculations, portion scaling and macro tolerance checks remain deterministic because a small language model should not be trusted with arithmetic.&lt;/p&gt;

&lt;p&gt;PantryPal also has a fallback mode. If Ollama is unavailable, the core application still works using code-based recommendations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Does Open Innovation Matter?
&lt;/h2&gt;

&lt;p&gt;Open innovation was important because this app handles highly personal information: body measurements, dietary preferences and pantry contents.&lt;/p&gt;

&lt;p&gt;With local inference:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the user's data stays on their laptop&lt;/li&gt;
&lt;li&gt;the application can work without internet after the model is downloaded&lt;/li&gt;
&lt;li&gt;there are no per-request API costs&lt;/li&gt;
&lt;li&gt;the model can be swapped for another compatible open-weight model&lt;/li&gt;
&lt;li&gt;prompts and validation rules can be changed for one person's needs&lt;/li&gt;
&lt;li&gt;the app remains useful even when the AI engine is offline&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A closed hosted API would have made the first version easier to connect, but it would have required sending personal dietary and pantry data to a service my friend does not control.&lt;/p&gt;

&lt;p&gt;Using Ollama and Qwen3-VL made privacy and offline operation part of the product instead of an afterthought.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building for a Friend
&lt;/h2&gt;

&lt;p&gt;I tested PantryPal using my friend's actual kitchen constraints rather than a generic demo profile.&lt;/p&gt;

&lt;p&gt;The most important design decisions came from their real situation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;recipes must work with the utensils they own&lt;/li&gt;
&lt;li&gt;recommendations should begin with ingredients already in the pantry&lt;/li&gt;
&lt;li&gt;missing ingredients should be clearly separated from available ingredients&lt;/li&gt;
&lt;li&gt;portions should match their goals&lt;/li&gt;
&lt;li&gt;the app should not require an account or internet connection&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;“I liked that it used what I already had instead of giving me another shopping list.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What I Learned
&lt;/h2&gt;

&lt;p&gt;The most useful architecture decision was keeping the language model away from calculations.&lt;/p&gt;

&lt;p&gt;The local model is good at choosing between culinary alternatives and rewriting instructions. Python is better at checking ingredients, calculating nutrition, scaling portions and enforcing constraints.&lt;/p&gt;

&lt;p&gt;That separation made the application more predictable while still giving it a natural, helpful interface.&lt;/p&gt;

&lt;h2&gt;
  
  
  License
&lt;/h2&gt;

&lt;p&gt;PantryPal is released under the MIT License.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>weekendchallenge</category>
      <category>hf26challenge</category>
    </item>
    <item>
      <title>CSS :has() Is the Parent Selector We Waited 20 Years For</title>
      <dc:creator>Ayush Kumar</dc:creator>
      <pubDate>Sat, 03 Oct 2026 18:20:38 +0000</pubDate>
      <link>https://dev.to/gruks/css-has-is-the-parent-selector-we-waited-20-years-for-4kbj</link>
      <guid>https://dev.to/gruks/css-has-is-the-parent-selector-we-waited-20-years-for-4kbj</guid>
      <description>&lt;p&gt;For years, the answer to "can CSS select a parent based on its children?" was a sad "no, use JavaScript."&lt;/p&gt;

&lt;p&gt;Not anymore. &lt;code&gt;:has()&lt;/code&gt; is supported in all modern browsers, and it changes how you write CSS. Here are three tricks you can use today.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Style a card differently if it contains an image
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.card&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;grid&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;gap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.card&lt;/span&gt;&lt;span class="nd"&gt;:has&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;img&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="py"&gt;grid-template-columns&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;200px&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="n"&gt;fr&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No extra classes like &lt;code&gt;.card--with-image&lt;/code&gt;. The CSS looks at the content and adapts.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Highlight a label when its input is invalid
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;label&lt;/span&gt;&lt;span class="nd"&gt;:has&lt;/span&gt;&lt;span class="o"&gt;(+&lt;/span&gt; &lt;span class="nt"&gt;input&lt;/span&gt;&lt;span class="nd"&gt;:invalid&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;crimson&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The label turns red when the input right after it fails validation. No JS, no state.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. A dark mode toggle with zero JavaScript
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"checkbox"&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"theme"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;label&lt;/span&gt; &lt;span class="na"&gt;for=&lt;/span&gt;&lt;span class="s"&gt;"theme"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Dark mode&lt;span class="nt"&gt;&amp;lt;/label&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nd"&gt;:root&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="py"&gt;--bg&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#fff&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;--fg&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#111&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nd"&gt;:root:has&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;#theme&lt;/span&gt;&lt;span class="nd"&gt;:checked&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="py"&gt;--bg&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#111&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;--fg&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#eee&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;body&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--bg&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--fg&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The checkbox lives anywhere in the page, and &lt;code&gt;:root&lt;/code&gt; reacts to it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus: it works like a "not" too
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="c"&gt;/* Dim all siblings when one is hovered */&lt;/span&gt;
&lt;span class="nt"&gt;ul&lt;/span&gt;&lt;span class="nd"&gt;:has&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="nd"&gt;:hover&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="nd"&gt;:not&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nd"&gt;:hover&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;opacity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Wrap up
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;:has()&lt;/code&gt; lets CSS respond to the &lt;em&gt;content and state&lt;/em&gt; of your markup, and that cuts a lot of "toggle a class" JavaScript.&lt;/p&gt;

&lt;p&gt;What's the coolest thing you've built with it? Let me know in the comments &lt;/p&gt;

</description>
      <category>css</category>
      <category>webdev</category>
      <category>frontend</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
