<?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: Harun Karahan</title>
    <description>The latest articles on DEV Community by Harun Karahan (@karahanharunn).</description>
    <link>https://dev.to/karahanharunn</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%2F346777%2Fda270f03-980d-444b-aabf-a1e7937e0303.jpg</url>
      <title>DEV Community: Harun Karahan</title>
      <link>https://dev.to/karahanharunn</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/karahanharunn"/>
    <language>en</language>
    <item>
      <title>Utility package for web developers in Flutter</title>
      <dc:creator>Harun Karahan</dc:creator>
      <pubDate>Sun, 19 May 2024 20:02:41 +0000</pubDate>
      <link>https://dev.to/karahanharunn/utility-package-for-web-developers-in-flutter-3d72</link>
      <guid>https://dev.to/karahanharunn/utility-package-for-web-developers-in-flutter-3d72</guid>
      <description>&lt;p&gt;[&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftyxv5lzmq99c4949tfu5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftyxv5lzmq99c4949tfu5.png" alt="Flutter gg example project " width="800" height="680"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;In this article, I will share how flutter_gg can improve your coding process and why you should prefer it in your next project.&lt;br&gt;
Before we start, here are key benefits you can expect from flutter_gg.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Modular styling&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Simplifying complex layouts that often involve many widgets in Flutter. ( Coding everything in one gg block as we do in web. )&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Reducing the time required to learn widgets and to adapt the framework for new Flutter developers.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Let's break down why we need flutter_gg. If you need opacity, padding, and a click event, you'll see something like this.&lt;br&gt;
List the problems we need to solve here.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5u9p5ozjr38ejehkveyv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5u9p5ozjr38ejehkveyv.png" alt=" Why we need to use additional solution " width="800" height="379"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The developer has to learn all these widgets to be able to code it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Reading code becomes difficult for developers. All these widgets affect text widgets and it's not easy to realize (imagine it's a bigger widget).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Whenever you need to edit the styling of your widget, you have to cut/paste a lot of times.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To keep your code clean, you will create hundreds of widgets.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;And we are going to improve the coding experience with flutter_gg.&lt;/p&gt;

&lt;p&gt;The first thing we are going to do is unify all of our styles into one variable.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3efzhbtdkx3duaw2etkb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3efzhbtdkx3duaw2etkb.png" alt=" Unify coding experience " width="800" height="263"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In order to achieve modular styling, we are going to create a style file for each of our screens.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1tq80z0snrz255qfc371.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1tq80z0snrz255qfc371.png" alt=" Modular styling " width="800" height="280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And here's the result. We made the code more readable and scalable in the long term. We can even use the same styles for different widgets without having to create additional custom widgets.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxsrw2b2qxprzs0g2r7vx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxsrw2b2qxprzs0g2r7vx.png" alt=" Solved issue using flutter_gg " width="800" height="180"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;You can find more details in the flutter_gg repo.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/karahanharunn/flutter_gg"&gt;https://github.com/karahanharunn/flutter_gg&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Check out the more detailed example I've created in Git Hub.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/karahanharunn/flutter_gg_card"&gt;https://github.com/karahanharunn/flutter_gg_card&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;In this article, I discussed a problem I encountered and shared my alternative solution with you! &lt;/p&gt;

&lt;p&gt;I hope you found it useful! Your insights and feedback are invaluable to me, thank you in advance for engaging with my content.&lt;/p&gt;

&lt;p&gt;Feel free to contact me on LinkedIn if you have any questions or require assistance.&lt;/p&gt;

&lt;p&gt;Harun Karahan | LinkedIn&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/karahanharunn/"&gt;https://github.com/karahanharunn/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>mobile</category>
      <category>webdev</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Why styled-system is so powerful</title>
      <dc:creator>Harun Karahan</dc:creator>
      <pubDate>Sat, 17 Feb 2024 07:05:53 +0000</pubDate>
      <link>https://dev.to/karahanharunn/why-styled-system-is-so-powerful-2nga</link>
      <guid>https://dev.to/karahanharunn/why-styled-system-is-so-powerful-2nga</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Definition of problem&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Last week, while working on a personal project, I wanted to use Tailwind CSS to enhance the design of my components, which were built with styled-components. Tailwind CSS is popular for its user-friendly design classes that make web development more efficient. However, I ran into a problem. Styled-components, the tool I used for creating my component library, didn’t work well with Tailwind CSS.&lt;/p&gt;

&lt;p&gt;Here’s why: styled-components applies styles directly to elements (inline styles), while Tailwind CSS applies styles through classes. This means you can’t easily use Tailwind’s classes to override styles created with styled-components.&lt;/p&gt;

&lt;p&gt;Additionally, when you want to make something customizable with styled-components, you often have to define each property individually, which can be something will make you tired in long term.&lt;/p&gt;

&lt;p&gt;I bet many of us have encountered similar codebases in various projects! :)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9tr1bds1l36utagy3rm1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9tr1bds1l36utagy3rm1.png" alt="Image description" width="800" height="442"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Most well-known solutions
&lt;/h2&gt;

&lt;p&gt;First, let’s list the pros and cons of the two most well-known approaches: Tailwind and Styled-Components. Then, I will introduce you to an alternative approach that is easier to use while still maintaining organization.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros of Tailwind CSS:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Rapid Development&lt;/strong&gt;: Tailwind’s utility-first approach makes it quicker to style components directly in your markup, speeding up the development process.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Customizable&lt;/strong&gt;: It offers deep customization options, allowing you to tailor the framework to fit your project’s specific needs.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Cons of Tailwind CSS:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Verbose HTML&lt;/strong&gt;: Your HTML can become cluttered with many class names, making it harder to read and maintain.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Over-reliance on Utilities:&lt;/strong&gt; There’s a risk of becoming too reliant on utility classes, which can lead to challenges in implementing more complex, custom designs that require traditional CSS.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Limited Flexibility with Other Libraries&lt;/strong&gt;: Tailwind’s class-level operation can limit its compatibility and flexibility when integrating with other libraries or frameworks that rely on different styling approaches.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Our second option is styled-components. Even though it’s more clean approach, you should spend important amount of time to make it custom and to gain typescript support.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros of Styled Components:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Component-Level Styling:&lt;/strong&gt; Allows for individual styling of components, making it easier to reuse and maintain them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dynamic Styling:&lt;/strong&gt; Facilitates the application of dynamic styles using props or themes, directly integrating with JavaScript logic.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CSS in JS:&lt;/strong&gt; Keeps styling closely associated with components, aiding in organization and minimizing styling conflicts.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Cons of Styled Components:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Performance Overhead:&lt;/strong&gt; The dynamic styling approach may lead to slight performance drops.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TypeScript Support:&lt;/strong&gt; While it offers TypeScript support, integrating styled-components with TypeScript can sometimes be complex and require additional typings.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cluttered JavaScript:&lt;/strong&gt; Embedding CSS within JavaScript can clutter components, particularly in larger projects, making the code harder to read.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;And &lt;strong&gt;here is why&lt;/strong&gt; styled-system is so powerful&lt;br&gt;
This tool can speed up your component building process and allows for easy style changes without updating your component library.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa76tis3s27egoyljbum7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa76tis3s27egoyljbum7.png" alt="Image description" width="800" height="942"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We did not define any types or properties ourselves and thanks to styled system for we can still update any property we want.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv5grblp8vid0fsrhsv96.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv5grblp8vid0fsrhsv96.png" alt="Image description" width="800" height="255"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this article, I discussed a problem I encountered and shared my alternative solution with you! I hope you found it useful!&lt;/p&gt;

&lt;p&gt;Your insights and feedback are invaluable to me, thank you in advance for engaging with my content.&lt;/p&gt;

&lt;p&gt;Feel free to contact me on LinkedIn if you have any questions or require assistance.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/in/karahanharunn/"&gt;Linkedin&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/karahanharunn/"&gt;Github&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>css</category>
      <category>tailwindcss</category>
      <category>styled</category>
    </item>
  </channel>
</rss>
