<?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: Moncef</title>
    <description>The latest articles on DEV Community by Moncef (@designobit).</description>
    <link>https://dev.to/designobit</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%2F904421%2Ff8155646-0b33-46e9-babf-b8c2a8ffcf8f.png</url>
      <title>DEV Community: Moncef</title>
      <link>https://dev.to/designobit</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/designobit"/>
    <language>en</language>
    <item>
      <title>4 Pro CSS Tricks Will Blow Your Mind</title>
      <dc:creator>Moncef</dc:creator>
      <pubDate>Wed, 10 Jul 2024 17:53:32 +0000</pubDate>
      <link>https://dev.to/designobit/4-pro-css-tricks-will-blow-your-mind-4mgg</link>
      <guid>https://dev.to/designobit/4-pro-css-tricks-will-blow-your-mind-4mgg</guid>
      <description>&lt;p&gt;CSS (Cascading style sheets) is one of the most popular technologies in web design, allowing developers to create visual and responsive designs. As a web developer, mastering CSS is crucial for bringing your design vision to life and ensuring a good user experience across all devices. Here are some tips you might not know in CSS:&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;1. Neumorphsime:&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Neumorphsime referred to soft UI design, is a popular design trend combining skeuomorphism and flat design. this style uses shadows and highlights to create a smooth look. here is how it works:&lt;/p&gt;

&lt;p&gt;First, we create a subtle background: to start with Neumotphsime, choose a soft background color like light gray,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;body {
  background-color: #eee;
  display: grid;
  place-content: center;
  height: 100vh;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;then we create an element with these styles&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.element {
  height: 100px;
  width: 100px;
  transition: all 0.2s linear;
  border-radius: 16px;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;finally, we add a box-shadow to the element when hovering&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.element:hover {
  box-shadow: 12px 12px 12px rgba(0, 0, 0, 0.1), -10px -10px 10px white;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;so we get this nice look&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%2F7wpburezlsn3t99j9h51.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%2F7wpburezlsn3t99j9h51.PNG" alt="Image description" width="800" height="487"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and you can make this too&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%2F34mds3pa23znl4pc3bsc.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%2F34mds3pa23znl4pc3bsc.PNG" alt="Image description" width="800" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;just add an inset to the box shadow like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.element:hover {
  box-shadow: 12px 12px 12px rgba(0, 0, 0, 0.1) inset, -10px -10px 10px white inset;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;2. Min() &amp;amp; Max() and clamp():&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;these tools are making websites and apps more dynamic and responsive. you can use these functions to control element sizing and resizing. and creating flexible typography here how:&lt;/p&gt;

&lt;p&gt;the min() function lets you set the smallest value from a list here how &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;before&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.container {
  width:800px;
  max-width:90%;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;after&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.container{
  width: min(800px,90%);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the max() function works the same as the min() function but takes the bigger value from a list here is how:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.container{
  width: max(800px,90%);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;sometimes you you set the width and min and max-width in one container there is another function named clamp() here is how it works&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;before&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.container {
  width:50vw;
  min-width:400px;
  max-width:800px;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;After&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.container {
  width: clamp(400px,50vw,800px);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;3. The :Has() and :Not() selector:&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;the &lt;strong&gt;:not()&lt;/strong&gt; selector represents elements that do not match a list of selectors&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.container:not(:first-child) {
  background-color: blue;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the &lt;strong&gt;:has()&lt;/strong&gt; selector represents an element if any of the relative selectors that are passed to as an argument match&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.container:has(svg) {
  padding: 20px;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;4. Text gradient:&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;for this trick, we can't add a gradient to the text color directly like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.text{
  color: linear-gradient(to right, red,blue);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;what we do instead&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.text{
  background: linear-gradient(to right, red,blue);
  background-clip:text;
  color:transparent;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and voila we get this awesome effect&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%2Fl5yxlvb7e0upa9ogbdol.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%2Fl5yxlvb7e0upa9ogbdol.PNG" alt="Image description" width="800" height="316"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusion:&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;By mastering one of these CSS techniques, you are going to elevate your web design skills to new heights. with only small adjustments with those techniques, you can lead to visually stunning results, and make your design more beautiful and user-friendly.&lt;/p&gt;

&lt;p&gt;you can check more in: &lt;a href="https://designobit.com/" rel="noopener noreferrer"&gt;https://designobit.com/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>css</category>
      <category>tutorial</category>
      <category>design</category>
    </item>
    <item>
      <title>Axios Vs Fetch: Which Should You Use For Your HTTP Requests?</title>
      <dc:creator>Moncef</dc:creator>
      <pubDate>Tue, 09 Jul 2024 11:34:35 +0000</pubDate>
      <link>https://dev.to/designobit/axios-vs-fetch-which-should-you-use-for-your-http-requests-n70</link>
      <guid>https://dev.to/designobit/axios-vs-fetch-which-should-you-use-for-your-http-requests-n70</guid>
      <description>&lt;p&gt;For most developers, fetching data is essential for modern applications to interact with APIs coming from the backend. and to achieve that we have several options the most popular ones are &lt;code&gt;AXIOS&lt;/code&gt; and &lt;code&gt;FETCH&lt;/code&gt;. while both have the same basic functions, at the same time they offer different features and developer experience. This article will dive deeper into the difference between both technologies, helping you decide which best suits your needs.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Why do we need HTTP request tools?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;HTTP request tools are important for handling complex responses, especially handling errors and parsing responses, tools like &lt;code&gt;Axios&lt;/code&gt; and &lt;code&gt;Fetch&lt;/code&gt; simplify these tasks by providing some features such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Error Handling&lt;/li&gt;
&lt;li&gt;Cross-browser Compatibility&lt;/li&gt;
&lt;li&gt;Handling Asynchronous Operations&lt;/li&gt;
&lt;li&gt;Simplifying Network Requests&lt;/li&gt;
&lt;li&gt;Developer-Experience&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Fetch API:&lt;/strong&gt; The fetch API is a built-in browser and javascript method for making HTTP requests. It is a more powerful and flexible replacement for XMLHttpRequest.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fetch API Usage&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fetch(URL)
  .then(response=&amp;gt;{
      //Handle response
  })
  .catch(error=&amp;gt;{
      //Handle error
  })
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Axios:&lt;/strong&gt; Axios is a popular third-party library for making HTTP requests. It makes managing and manipulating requests easier.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Axios installation&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ npm install axios
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Axios usage&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import axios from 'axios';

axios.get('https://api.example.com/data') 
  .then(response =&amp;gt; { console.log(response.data) }) 
  .catch(error =&amp;gt; { console.error('Error:', error) }); 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Key differences&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Handling JSON&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fetch:&lt;/strong&gt; Requires manual conversion of response data to JSON&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fetch('https://api.example.com/data')
  .then(response =&amp;gt; response.json()) // Manual conversion
  .then(data =&amp;gt; console.log(data));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Axios:&lt;/strong&gt; Automaticlly parses JSON responses&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;axios.get('https://api.example.com/data')
  .then(response =&amp;gt; console.log(response.data)); // Automatic conversion
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Handling error&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fetch:&lt;/strong&gt; Reject only a network error promise, not an HTTP error  (e.g., 404 or 500 status codes).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fetch('https://api.example.com/data')
  .then(response =&amp;gt; {
    if (!response.ok) {
      throw new Error('Network response was not ok');
    }
    return response.json();
  })
  .catch(error =&amp;gt; console.error('Fetch error:', error));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Axios:&lt;/strong&gt; Rejects a promise for both network errors and HTTP errors.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;axios.get('https://api.example.com/data')
  .catch(error =&amp;gt; console.error('Axios error:', error));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Request Configuration&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fetch:&lt;/strong&gt; Requires manual configuration of options like headers and method&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fetch('https://api.example.com/data', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({ key: 'value' })
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Axios:&lt;/strong&gt; Provides a more concise and readable syntax for configuration.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;axios.post('https://api.example.com/data', { key: 'value' }, {
  headers: {
    'Content-Type': 'application/json'
  }
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;both Axios and Fetch are excellent for fetching data in Javascript, they offer lots of features, ease of use, and reliable performance, but you need to consider these 3 things before using one of them:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Fetch when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;you prefer using a built-in API without additional dependencies&lt;/li&gt;
&lt;li&gt;your project needs to stay lightweight&lt;/li&gt;
&lt;li&gt;you are comfortable handling JSON transformation and error checking manually&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Use Axios when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It would be best to go with a cleaner syntax and more readable code.&lt;/li&gt;
&lt;li&gt;You want built-in support for request and response interceptors, timeout, and cancellation.&lt;/li&gt;
&lt;li&gt;You prefer automatic JSON transformation and simpler error handling.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;by knowing these factors, you are ready to make a decision that fits your project’s requirements and your developer experience&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>react</category>
    </item>
  </channel>
</rss>
