Muhi Masri (@muhimasri) 's Twitter Profile
Muhi Masri

@muhimasri

πŸ‘¨πŸ»β€ Frontend Engineer | Educator | Consultant @MDA_space
🐀 Tweet coding tips & learnings
πŸ“™ Weekly tutorials muhimasri.com

ID: 778679390

linkhttps://uishop.io calendar_today24-08-2012 17:54:46

2,2K Tweet

558 Followers

125 Following

Muhi Masri (@muhimasri) 's Twitter Profile Photo

I had a task to make a #CSS grid column dynamic. Basically, I was required to hide the third column if there was no content. I created a solution with only CSS logical selectors: 1️⃣ Create a variable for the number of columns. 2️⃣ Use `:has` to check if the parent grid has an

Muhi Masri (@muhimasri) 's Twitter Profile Photo

πŸ’‘ Defining a set of font sizes is essential for maintaining consistency and improving efficiency. With SCSS, we can create a map of size tokens, generate the corresponding #CSS classes using a mixin, and then apply it to any element:

πŸ’‘ Defining a set of font sizes is essential for maintaining consistency and improving efficiency.

With SCSS, we can create a map of size tokens, generate the corresponding #CSS classes using a mixin, and then apply it to any element:
Muhi Masri (@muhimasri) 's Twitter Profile Photo

πŸ’‘ An excellent use-case for CSS `pointer-events: none;` is when implementing drag and drop functionality. This property disables interactions with form inputs during hover. Here are a few steps to achieve the desired visual effect: 1️⃣ Apply pointer-events: none; on hover to

Muhi Masri (@muhimasri) 's Twitter Profile Photo

πŸ’‘ Using `Promise.resolve()` is a great way to ensure your functions always return a promise, even for default or cached values. This keeps the promise chain intact when dealing with a value that wasn't originally a promise.

πŸ’‘ Using `Promise.resolve()`  is a great way to ensure your functions always return a promise, even for default or cached values.

This keeps the promise chain intact when dealing with a value that wasn't originally a promise.
Muhi Masri (@muhimasri) 's Twitter Profile Photo

πŸš€ First time trying the MDN progressive web app (PWA) on my phone. Works like a charm. Just go to the site and you'll get the download option directly from the web. No app store required πŸ‘πŸΌ

Muhi Masri (@muhimasri) 's Twitter Profile Photo

πŸ“‘ Component composition in #React is a powerful pattern for reusability. I'm excited to release my latest tutorial, explaining how we can extend and customize a `fieldset` element with MUI to improve development efficiency and make customization simpler and faster. 1️⃣ Exposing

πŸ“‘ Component composition in #React is a powerful pattern for reusability.

I'm excited to release my latest tutorial, explaining how we can extend and customize a `fieldset` element with MUI to improve development efficiency and make customization simpler and faster.

1️⃣ Exposing
Muhi Masri (@muhimasri) 's Twitter Profile Photo

🎨 Customize and extend a `fieldset` element with #React and MUI: 1️⃣ Create a custom component that wraps `fieldset` and `legend` elements. 2️⃣ Use a `title` prop to dynamically show or hide the legend. 3️⃣ Expose and group styling props to simplify customization. Component code:

🎨 Customize and extend a `fieldset` element with #React and MUI:

1️⃣ Create a custom component that wraps `fieldset` and `legend` elements.
2️⃣ Use a `title` prop to dynamically show or hide the legend.
3️⃣ Expose and group styling props to simplify customization.

Component code:
Muhi Masri (@muhimasri) 's Twitter Profile Photo

πŸ’‘ Using ReactNode as a prop type in a #React component is a great way to allow flexibility in what can be passed as a prop. For example, a Card component could take a simple string title or a more advanced h1 element:

πŸ’‘ Using ReactNode as a prop type in a #React component is a great way to allow flexibility in what can be passed as a prop.

For example, a Card component could take a simple string title or a more advanced h1 element:
Muhi Masri (@muhimasri) 's Twitter Profile Photo

πŸ”Ž TODO Tree extension has always been one of my favorites for managing small tasks. Today, just discovered that I can create a checklist 😍

πŸ”Ž TODO Tree extension has always been one of my favorites for managing small tasks. Today, just discovered that I can create a checklist 😍
Muhi Masri (@muhimasri) 's Twitter Profile Photo

πŸš€ When using `fetch` with mode: 'no-cors' in #JavaScript, you can send simple requests to external servers without triggering CORS errors. That doesn't mean you can bypass the CORS policy; it only avoids an error, but the results will be opaque and can't be seen. Perfect for

πŸš€ When using `fetch` with mode: 'no-cors'  in #JavaScript, you can send simple requests to external servers without triggering CORS errors.

That doesn't mean you can bypass the CORS policy; it only avoids an error, but the results will be opaque and can't be seen.

Perfect for