<?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: Firas Lajmi</title>
    <description>The latest articles on DEV Community by Firas Lajmi (@firas_lajmi_).</description>
    <link>https://dev.to/firas_lajmi_</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%2F1653417%2Fc903790a-fa98-480a-bf43-6ff3c45f9a36.png</url>
      <title>DEV Community: Firas Lajmi</title>
      <link>https://dev.to/firas_lajmi_</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/firas_lajmi_"/>
    <language>en</language>
    <item>
      <title>Some UX Design Principles Everyone Should Know ✨</title>
      <dc:creator>Firas Lajmi</dc:creator>
      <pubDate>Thu, 20 Jun 2024 01:17:27 +0000</pubDate>
      <link>https://dev.to/firas_lajmi_/some-ux-design-principles-everyone-should-know-oe4</link>
      <guid>https://dev.to/firas_lajmi_/some-ux-design-principles-everyone-should-know-oe4</guid>
      <description>&lt;p&gt;Hitting the ground running with a new app idea is tough. There are a million things to do and no time to do them. You’ve gone through the “justification” phase, explaining to everyone and their mom why the world needs your application. You’ve documented every single forecast and business plan. Now it’s time to start thinking about actually executing your vision. It all begins with User Experience. Great UX design isn't an afterthought or a “nice to have”; it's an absolute necessity for any application aiming to stand out and thrive. That said, let's dive into some UX design principles that everyone should know.&lt;/p&gt;

&lt;h2&gt;
  
  
  User-Centered Design🗣️
&lt;/h2&gt;

&lt;p&gt;First things first: always put your users at the center of your design process. This means understanding their needs, behaviors, and pain points. It's not about what you think looks good; it's about making sure your users can accomplish the goal you’ve set out for them with the least amount of resistance.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Conduct User Research&lt;/strong&gt;: Surveys, interviews, and usability tests are your best friends here.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Create Personas&lt;/strong&gt;: Develop detailed profiles of your target users to guide your design decisions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;User Journey Mapping&lt;/strong&gt;: Map out the steps users take to complete tasks within your application, to identify opportunities for improvement.
**&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Simplicity and Clarity🧘
&lt;/h2&gt;

&lt;p&gt;Less is more. Seriously. Don't overload your users with information or options. Keep your design clean, straightforward, and intuitive. As users flock to your application, you’ll be able to take their feedback and make well educated, data-driven decisions about what to improve.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Clear Navigation&lt;/strong&gt;: Make sure users can easily find what they need without getting lost. Don’t hide primary actions behind layers of interaction.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Minimalist Design&lt;/strong&gt;: Remove any unnecessary elements that don't add value. Truly ask yourself why something exists, and how it aids in users accomplishing their goals.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Readable Content&lt;/strong&gt;: Use clear, concise language and break up text with headings, bullet points, or some very cool emojis if you’re hip 😎.
**&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Consistency
&lt;/h2&gt;

&lt;p&gt;Like all things, consistency is key. Especially when it comes to creating a seamless user experience. This means maintaining uniformity in your design elements across your website or app.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Design System&lt;/strong&gt;: I love design systems. There’s nothing better than an organized style guide that includes typography, color schemes, button styles, and all the little components that make your application unique.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Consistent Interactions&lt;/strong&gt;: Make sure similar actions produce similar results throughout your site. Don’t have twelve different variations of that modal. People notice, and it makes you look silly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Branding&lt;/strong&gt;: Keep your branding elements consistent to build trust and foster that brand recognition.
**&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Accessibility
&lt;/h2&gt;

&lt;p&gt;Accessibility needs to be top of mind at the outset of any project. Baking accessibility best practices into the UX and design phase of your application will ensure you’re providing an equitable experience for each and every one of your users, regardless of how they interact with the web. Make sure you’re at a minimum making these considerations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Alt Text for Images&lt;/strong&gt;: This is too easy not to be doing. Provide descriptive text for images to assist screen readers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keyboard Navigation&lt;/strong&gt;: Not everyone browses the web with a mouse or a $130 Apple trackpad. Make considerations for those who navigate with a keyboard.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Contrast Ratios&lt;/strong&gt;: I’m old and this one bothers me more and more. Do a quick check to make your text has at least a AA contrast ratio. There are several tools for this. Pick one.
**&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Feedback and Responsiveness
&lt;/h2&gt;

&lt;p&gt;In our wild world of JavaScript applications, ensuring that a user knows that something is happening, has become more important than in the past. Our applications connect to more third-party services these days, and our users must know that an action they’ve taken is processing. We use these strategies to help with that;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Loading Indicators / Skeletons&lt;/strong&gt; 💀: Skeleton loaders not only sound cool, they also provide anticipatory design elements that give users a sense of what will be on the page, before the data has fully loaded.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Error Messages&lt;/strong&gt;: Provide clear, helpful error messages when something goes wrong. There’s nothing worse than a user seeing Uncaught - - &lt;strong&gt;ReferenceError&lt;/strong&gt;: Invalid left-hand side in assignment or some other nonsense. Give them plain English feedback instead!
Performance Optimization: This is becoming more and more tricky. The more services we integrate, the more complex a database becomes the more creative you have to get to ensure an application is performant.
**&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Emotional Design
&lt;/h2&gt;

&lt;p&gt;This is such a cool concept to us. Emotional design focuses more on creating experiences that evoke a particular feeling from your users. As cliche, as it may sound, this creates a unique connection and keeps your users feeling positive about the service you’re providing them. This can be done in a few ways;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Storytelling&lt;/strong&gt;: Visual storytelling on the web is an art form. We love expressing our creativity through creating a full-fledged digital experience.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Micro-Interactions&lt;/strong&gt;: Small, thoughtful animations and interactions tend to put you in a position to entertain and engage your users and drive them to keep coming back.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Human Touch&lt;/strong&gt;: Incorporate human elements, like friendly language, relatable imagery, or exceptionally witty content, like the content you’re reading right this second.
**&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Iterative Design
&lt;/h2&gt;

&lt;p&gt;Everything is iterative. After you build an MVP, it’s back to the drawing board. Starting the process over and continuously iterating is the only way to keep pace with the multi-billion dollar applications that exist in our world. Stay engaged with your user base, listen to their feedback, and they’ll remain loyal to you.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Usability Testing&lt;/strong&gt;: Regularly test your designs with real users. This is and always will be something that the tech giants miss out on. Don’t miss the mark here.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A/B Testing&lt;/strong&gt;: Get super granular with this. A/B test simple language, or small components, and use that information to inform the larger design.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Analytics&lt;/strong&gt;: Use data to inform all of your decisions. There needs to be a why, and data will uncover it.
**&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Focus on Business Goals
&lt;/h2&gt;

&lt;p&gt;**While user satisfaction is paramount, your application should align with your business objectives. All that work you did at the inception of your idea shouldn’t go to waste. The forecasts and the documentation are invaluable, but balance user needs with your goals. No bullet points here, those business goals are yours to define. We’ll be here to help you refine and execute them.&lt;/p&gt;

&lt;p&gt;Keep testing, collaborating, learning, and evolving.&lt;/p&gt;

</description>
      <category>ux</category>
      <category>webdev</category>
      <category>design</category>
    </item>
    <item>
      <title>HTML tips and tricks.</title>
      <dc:creator>Firas Lajmi</dc:creator>
      <pubDate>Wed, 19 Jun 2024 19:54:48 +0000</pubDate>
      <link>https://dev.to/firas_lajmi_/html-tips-and-tricks-22ok</link>
      <guid>https://dev.to/firas_lajmi_/html-tips-and-tricks-22ok</guid>
      <description>&lt;p&gt;In my very last article I shared some JavaScript tips and tricks In this article I will be covering HTML tips and tricks ✨.&lt;/p&gt;

&lt;p&gt;The start attribute&lt;br&gt;
Start attribute allows you to specify starting number for your list items.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; &amp;lt;ol start="20"&amp;gt;
       &amp;lt;li&amp;gt;Pineapple🍍&amp;lt;/li&amp;gt;
       &amp;lt;li&amp;gt;Apple🍎&amp;lt;/li&amp;gt;
       &amp;lt;li&amp;gt;Greenapple 🍏&amp;lt;/li&amp;gt;
 &amp;lt;/ol&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3 items of fruits starting from 20 20 is specified using the start attribute3 items of fruits&lt;/p&gt;

&lt;p&gt;The contenteditable attribute&lt;br&gt;
Set contenteditable attribute to true and your content will be editable.&lt;br&gt;
 &lt;/p&gt;
&lt;p&gt;It Can be something about you.&lt;/p&gt; &lt;br&gt;
GIFillustration of editable paragraph achived using contenteditable attribute

&lt;p&gt;The required attribute&lt;br&gt;
Set required attribute on input fields that are mandatory to be filled.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;input type="password" required&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The mark tag&lt;br&gt;
Use mark instead of styling spans to highlight text.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; &amp;lt;p&amp;gt;This is &amp;lt;mark&amp;gt;important&amp;lt;/mark&amp;gt; &amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;highlighted text achieved with mark tag&lt;/p&gt;

&lt;p&gt;The lazy loading attribute&lt;br&gt;
Add lazy loading attribute on media elements this will enhance page performance by defer the loading of media elements until the user scrolls to them.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/image.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/image.jpg" alt="Alternative text"&gt;&lt;/a&gt;&lt;br&gt;
The kbd tag&lt;br&gt;
Use kbd tag when presenting keyboard inputs.&lt;/p&gt;

&lt;p&gt;Press alt &amp;amp; tab to change window&lt;/p&gt;

&lt;p&gt;illustration for kbd tag&lt;/p&gt;

&lt;p&gt;The Details &amp;amp; Summary tag&lt;br&gt;
You can craft nice looking accordions using details and summary elements this has built built in keyboard accessibility features.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   &amp;lt;details&amp;gt;
      &amp;lt;summary&amp;gt;Can i save and love ❤️ this article?&amp;lt;/summary&amp;gt;
      &amp;lt;p&amp;gt;Follow on twitter for more stuff.&amp;lt;/p&amp;gt;
      &amp;lt;p&amp;gt;Save for updates.&amp;lt;/p&amp;gt;
  &amp;lt;/details&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;GIFaccordion with question and answer&lt;/p&gt;

&lt;p&gt;The accept attribute&lt;br&gt;
Accept attributes allows us to specify which types of files user can upload.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;input type="file" accept=".jpg, .pdf"&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The favicon&lt;br&gt;
Set link rel to icon to define favicon&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;link rel="icon" href="logo.webp"&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The picture tag&lt;br&gt;
Picture tag allows you to present images of different aspect ratios based on screen sizes picture tag is awesome for implementing reponsive web design.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;picture&amp;gt;
    &amp;lt;source srcset="large.webp" media="(min-width: 1200px)"&amp;gt;
    &amp;lt;source srcset="medium.webp" media="(min-width: 800px)"&amp;gt;
    &amp;lt;img src="regular.jpg" /&amp;gt;
&amp;lt;/picture&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The dir attribute&lt;br&gt;
You can set your text direction from right to left or left to right using direction set dir to auto this will automatically change text direction based on language.&lt;/p&gt;

&lt;p&gt;Awesome!&lt;/p&gt;

&lt;p&gt;some text written from right to left&lt;/p&gt;

&lt;p&gt;The spellcheck attribute&lt;br&gt;
Use spellcheck attribute to check for spelling errors.&lt;br&gt;
&lt;br&gt;
The meta description&lt;br&gt;
Add meta descriptions in the head of your Html to have an indirect impact on search engine optimization meta description represents the text that appears beneath the site name on search engine result page.&lt;br&gt;
&lt;br&gt;
Gitpod.io url with output of meta description&lt;/p&gt;

&lt;p&gt;The abbr tag&lt;br&gt;
Abbreviate your content using abbr tag.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;abbr title="National Aeronautics and Space Administration"&amp;gt;NASA 🚀&amp;lt;/abbr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;GIFAbbreviation of word showing on hover over the word&lt;/p&gt;

&lt;p&gt;The disabled attribute&lt;br&gt;
Use disabled attribute for options element to disable a item from dropdown.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; &amp;lt;select&amp;gt;
   &amp;lt;option&amp;gt;HTML&amp;lt;/option&amp;gt;
   &amp;lt;option&amp;gt;CSS&amp;lt;/option&amp;gt;
   &amp;lt;option disabled&amp;gt;REACT&amp;lt;/option&amp;gt;
 &amp;lt;/select&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;GIFUnable to select a option from list because of disabled attribute&lt;/p&gt;

&lt;p&gt;The poster attribute&lt;br&gt;
Poster attributes allows you to specify a image to be displayed while the video is downloading or until the user hits the play button.&lt;/p&gt;



&lt;p&gt;The reversed attribute&lt;br&gt;
Using reversed attribute you can reverse the order of list numbers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  &amp;lt;ol reversed&amp;gt;
        &amp;lt;li&amp;gt;Pineapple🍍&amp;lt;/li&amp;gt;
        &amp;lt;li&amp;gt;Apple🍎&amp;lt;/li&amp;gt;
        &amp;lt;li&amp;gt;Greenapple 🍏&amp;lt;/li&amp;gt;
  &amp;lt;/ol&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;list numbers starting in reversed order starting from 3 and ending at 1 instead of 1 to 3&lt;/p&gt;

&lt;p&gt;Hope you enjoyed reading this article! if you have something to say or have any questions feel 💯 free to comment below.&lt;/p&gt;

&lt;p&gt;Happy Coding ✨❤️&lt;/p&gt;

</description>
      <category>html</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>JavaScript tips and tricks.</title>
      <dc:creator>Firas Lajmi</dc:creator>
      <pubDate>Wed, 19 Jun 2024 19:52:35 +0000</pubDate>
      <link>https://dev.to/firas_lajmi_/javascript-tips-and-tricks-4l06</link>
      <guid>https://dev.to/firas_lajmi_/javascript-tips-and-tricks-4l06</guid>
      <description>&lt;p&gt;In this article we will look at some useful JavaScript tips and tricks.&lt;/p&gt;

&lt;p&gt;location.reload()&lt;br&gt;
This reloads the current document and works same as the reload button in your browser.This can be really handy when implementing a refresh button in the user interfaces.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const btnRefresh = document.querySelector('button')

btnRefresh.addEventListener('click',() =&amp;gt; {
  location.reload()
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;JavaScript styles&lt;br&gt;
CSS styles applied using javascript are applied as inline styles.&lt;/p&gt;

&lt;h1&gt;Cakes &amp;amp; Bakes 🧁&lt;/h1&gt; 

&lt;p&gt;document.querySelector('h1').style.color = "coral"&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;h1 style="color: coral;"&amp;gt;  // HTML Element
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Type coercion&lt;br&gt;
Implicit conversion of values from one data type to another data type is named as type coercion i.e strings to numbers.&lt;/p&gt;

&lt;p&gt;In case of plus operator values are concatenated and converted into strings.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log("2" * 10)  // output: 20
console.log(10 - '2')  // output: 8
console.log(2 + '2')   // output: '22'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Active element&lt;br&gt;
if you are having hard time figuring out which element is currently being focused use document.activeElement it returns the current focused element.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(document.activeElement)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Primitives&lt;br&gt;
In JavaScript there are seven primitive data types.&lt;br&gt;
number, string, boolean, undefined, null, BigInt, Symbol&lt;br&gt;
Remainder operator&lt;br&gt;
Remainder operator % simply returns the remainder of a division i.e 5 % 2 = 1.You can use remainder operator to check either a number is even or odd&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const number = 10

console.log(number % 2 === 0 ? 'Even ❤️' : 'Odd 🧡') 
// output: Even ❤️
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Design mode&lt;br&gt;
Set document.designMode to on to make your webpage content editable.&lt;br&gt;
document.designMode = "on" &lt;br&gt;
Contains method&lt;br&gt;
To check either a HTML element contains a specific class or not.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;h1 class="title"&amp;gt;Page title&amp;lt;/h1&amp;gt;
document.querySelector('h1').classList.contains('title')
document.querySelector('h1').classList.contains('subtitle')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// output: true
// output: false 
Var hoisting
Variables declared with var are hoisted but returns undefined.
console.log(a)
var a = 10;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// output: undefined
Remove method
Remove methods allows you to remove an HTML from the document.
&amp;lt;h1&amp;gt;Page title ⚙️&amp;lt;/h1&amp;gt; 
const pageTitle = document.querySelector('h1')
pageTitle.remove()
Eval method
Eval is a builtin Javascript function which allows you to evaluate the given values i.e strings, numbers.This can be used to build a simple calculator like this.
eval(2 * '5')  
// output: 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;eval(12 / '2')  
// output: 6 
Typeof operator
The typeof operator allows you to check type of a value.
console.log(typeof 42);
// output: "number"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(typeof 'markdown ⚡');
// output: "string"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(typeof true);
// output: "boolean"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace method&lt;br&gt;
The replace method allows you to replace the very first instance of a string entity with the specified entity likewise replace we also have replaceAll that replaces all the instances.&lt;br&gt;
const string = 'cake'&lt;br&gt;
string.replace('c','b')&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// output: 'bake'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Default parameters&lt;br&gt;
Set default parameters for functions using assignment operator in case no argument is passed the function will return the default values.&lt;/p&gt;

&lt;p&gt;I wrote this article to cover this topic in detail.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; function printName(name = "Anonymous"){
  console.log(name)
 }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; printName()  // output: "Anonymous"
Document url
The document.URL returns the document URL/location as a string.
console.log(document.URL)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;// output: "&lt;a href="https://developer.mozilla.org/en-US/"&gt;https://developer.mozilla.org/en-US/&lt;/a&gt;" &lt;br&gt;
Strings index&lt;br&gt;
Likewise arrays string indexes also start with 0.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let string = 'cake'
string[0]  // output: 'c'
string[1]  // output: 'a'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Includes method&lt;br&gt;
To check either a string or array contains a specific value or not. The method returns a boolean.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const string = 'JavaScript'

string.includes('J')  // output: true

const hearts = ['🧡', '💙', '🤍']

console.log(hearts.includes('🧡'))  // output: true

console.log(hearts.includes('❤️'))  // output: false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hope you enjoyed reading this article! if you have something to say or have any questions feel 💯 free to comment below.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>22 Useful CSS Tips and Tricks Every Developer Should Know</title>
      <dc:creator>Firas Lajmi</dc:creator>
      <pubDate>Wed, 19 Jun 2024 19:49:28 +0000</pubDate>
      <link>https://dev.to/firas_lajmi_/22-useful-css-tips-and-tricks-every-developer-should-know-5cbh</link>
      <guid>https://dev.to/firas_lajmi_/22-useful-css-tips-and-tricks-every-developer-should-know-5cbh</guid>
      <description>&lt;p&gt;🚨🚨 Note: All the tips, tricks shared in this article are part of GitHub repository css tips tricks A handmade collection of pro css tips tricks for developers. Please checkout the repositiory and Give it a star if you find it useful 🌟&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Docs Layout
Create a responsive documentation-styled layout with only two lines of CSS.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.parent{
  display: grid;
  grid-template-columns: minmax(150px, 25%) 1fr;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;The Custom Cursors
Checkout the github repository css tips tricks to learn more about it.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;html{
  cursor:url('no.png'), auto;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;GIFimage with custom cursor&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Fill Text With Images
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;h1{
  background-image: url('images/flower.jpg');
  background-clip: text;
  color: transparent;
  background-color: white;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Air max&lt;/p&gt;

&lt;p&gt;Note: Always specify background-color when using this technique as this will be used as a fallback value in case the image does not load for some reason.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Adding Stroke to Text
Make text more legible and visible using text-stroke property it adds a stroke or outline to text.
/* 🎨 Apply a 5px wide crimson text stroke to h1 elements */
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;h1 {
  -webkit-text-stroke: 5px crimson;
  text-stroke: 5px crimson;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;NETLIFY&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Paused Pseudo Class
Use :paused selector to style media elements when in paused state likewise :paused we also have :playing.
/* 📢 currently, only supported in Safari */
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;video:paused {
  opacity: 0.6;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;GIFplam tree on river&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Emphasing Text
Use text-emphasis property to apply emphasis marks to text elements.You can specify any string including emojis as its value.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;h1 {
  text-emphasis: "⏰";
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Time is a healer&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Style Drop Caps
Avoid unnecessary spans and use pseudo elements instead to style your content likewise first-letter pseudo-element we also have first-line
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pseudo-element.
 h1::first-letter{
  font-size: 2rem;
  color:#ff8A00;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Gitpod.io&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Fallback values for Variables
/* 🎨 crimson color will be applied as var(--black) is not defined */
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:root {
  --orange: orange;
  --coral: coral;
}

h1 {
  color: var(--black, crimson);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;crimson colored text &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Change Writing Mode
You can use writing mode property to specify how text should be laid out on your website i.e vertically or horizontally.
&lt;h1&gt;Cakes &amp;amp; Bakes&lt;/h1&gt;
/* 💡 specifies the text layout direction to sideways-lr  */
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;h1 {
  writing-mode: sideways-lr;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;text starting from&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Rainbow Animation
Creates a continuously looping color animation for elements to grab user attention. Give a read to css tips tricks repository to learn when to use prefer-reduced-motion media feature
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;button{
  animation: rainbow-animation 200ms linear infinite;
}
@keyframes rainbow-animation {
  to{
    filter: hue-rotate(0deg);
  }
 from{
    filter: hue-rotate(360deg);
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;GIFshop now button changing its color contineously&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Master Web Development
Subscribe to our YouTube channel to take your web-development skills to the next level. One of the recent video series goes over creating the following open source portfolio template.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Imon&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Zooming on Hover
/* 📷 Define the height and width of the image container &amp;amp; hide overflow */
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.img-container {
  height: 250px; width: 250px; overflow: hidden;
 }

/* 🖼️ Make the image inside the container fill the container */

.img-container img {
  height: 100%; width: 100%; object-fit: cover; 
  transition: transform 200m ease-in;
 }

 img:hover{
  transform: scale(1.2);
 }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;GIFcrimson colored shopping bag laying on grey tiles&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Attribute Selector
Select HTML elements based on attributes using the attribute selector.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;a href=""&amp;gt;HTML&amp;lt;/a&amp;gt;
&amp;lt;a&amp;gt;CSS&amp;lt;/a&amp;gt;
&amp;lt;a href=""&amp;gt;JavaScript&amp;lt;/a&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;/* 🔗 targets all a elements that have a href attribute */&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a[href] {
  color: crimson;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;HTML CSS JavaScript&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Clipping Elements
Use the clip-path property, to create interesting visual effects, such as clipping an element to a custom shape like a triangle or hexagon.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;div {
  height: 150px;
  width: 150px;
  background-color: crimson;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;triangle&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Detect Properties Support
Use CSS &lt;a class="mentioned-user" href="https://dev.to/support"&gt;@support&lt;/a&gt; rule to detect support for CSS features directly in your CSS. Checkout the css tips tricks repository to learn more about feature queries.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@supports (accent-color: #74992e) {
/* code that will run if the property is supported */
  blockquote {
    color: crimson;
  }

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Never break your promise.(Hazrat Ali A.S)&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;CSS Nesting
The CSS working group has been working on figuring out how to add nesting to CSS. With nesting, you'll be able to write CSS that is more intuitive, more organized, and more efficient.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;header class="header"&amp;gt;
  &amp;lt;p class="text"&amp;gt;Lorem ipsum, dolor&amp;lt;/p&amp;gt;
&amp;lt;/header&amp;gt;
/* 🎉 You can try CSS nesting now in Safari Technology Preview*/

.header{

  background-color: salmon;

  .text{
    font-size: 18px;
  }

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;The Clamp Function
Use the clamp()function for responsive and fluid typography.
/* Syntax: clamp(minimum, preferred, maximum) */
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;h1{
  font-size: clamp(2.25rem,6vw,4rem);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;GIFgif font size changing based on screen size&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Styling Optional Fields
You can style form fields like input, select and textarea that dose not have a required attribute on them using the :optional pseudo class.
/* Selects  all optional form fields on the page */
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;*:optional{
  background-color: green;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Word Spacing Property
Use word-spacing property to specify length of white space between words.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;p {
  word-spacing: 1.245rem;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Create Gradient Shadows
This is how you can create gradient shadows for an exclusive user experience.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:root{
  --gradient: linear-gradient(to bottom right, crimson, coral);
}

div {
  height: 200px;
  width: 200px;
  background-image: var(--gradient);
  border-radius: 1rem;
  position: relative;
}

div::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--gradient);
  border-radius: inherit;
  filter: blur(25px) brightness(1.5);
  transform: translateY(15%) scale(0.95);
  z-index: -1;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;box with gradient shadow&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Change Caption Side
Use the caption-side property to place the table caption (table title) on a specified side of the table.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;GIFChanging the tables caption side from top to bottom&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Creating Text Columns
Craft nice column layouts for text elements using column properties.
/* 🏛️ divide the content of the "p" element into 3 columns  */
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;p{
  column-count: 3;
  column-gap: 4.45rem;          
  column-rule: 2px dotted crimson;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;css tips and tricks poem&lt;/p&gt;

&lt;p&gt;I hope you enjoyed reading this article. Please checkout the GitHub repository css tips tricks to learn more professional css tips, tricks and don't forget to give the repository a star⭐ This will help other peoples find this repository.&lt;/p&gt;

&lt;p&gt;You can show your support by following me on my GitHub account. Thanks and Happy coding ❤️&lt;/p&gt;

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