Skip to main content

Box-shadow in css in shadow-sm/lg/md in Tailwind css

 Perfect πŸ‘ let’s fully explain this version of the box-shadow:

box-shadow: 10px 10px 20px 5px rgba(0,0,0,0.3);

🧩 General Syntax

box-shadow: offset-x offset-y blur-radius spread-radius color;

πŸ” Breakdown of your values:

ValuePartMeaning
10pxoffset-xMoves the shadow 10px to the right.
10pxoffset-yMoves the shadow 10px downward.
20pxblur-radiusMakes the shadow soft and blurry — larger number = more blur.
5pxspread-radiusExpands the size of the shadow outward by 5px (makes it thicker/wider).
rgba(0,0,0,0.3)colorA semi-transparent black shadow (opacity 0.3 = 30% visible).

🧠 Visualization:

If you have a box like this:

<div class="card">Box</div>

And the CSS:

.card { width: 150px; height: 100px; background: white; box-shadow: 10px 10px 20px 5px rgba(0,0,0,0.3); }

✅ The result will look like:

  • A white box

  • Shadow slightly to the bottom-right (10px each way)

  • Softly blurred (20px) and spread outward (5px)

  • With a grayish look because of the semi-transparent black


🎨 Quick tip:

If you want a softer, lifted card look, try:

box-shadow: 0 4px 10px rgba(0,0,0,0.2);

If you want a stronger, dramatic effect, try:

box-shadow: 10px 10px 30px rgba(0,0,0,0.5);


Comments

Popular posts from this blog

Ternary operator and its working on mechanism on array

  If condition is true → use valueIfTrue If condition is false → use valueIfFalse ✅ Your amenity example Your code: {amenity === 'wifi' ? 'WIFI' : amenity} Breakdown: ✔ Condition: amenity === 'wifi' This checks: “Is the current amenity equal to 'wifi'?” ✔ If condition is TRUE → show: 'WIFI' ✔ If condition is FALSE → show: amenity 🎯 Example with your amenitiesList const amenitiesList = [ 'wifi' , 'parking' , 'kitchen' ]; Looping through each item: πŸ”Ή 1. amenity = "wifi" Check condition: 'wifi' === 'wifi' → TRUE So ternary returns: 'WIFI' πŸ‘‰ Display: WIFI πŸ”Ή 2. amenity = "parking" Check condition: 'parking' === 'wifi' → FALSE So ternary returns: amenity // which is "parking" πŸ‘‰ Display: parking πŸ”Ή 3. amenity = "kitchen" Check condition: 'kitchen' === 'wifi' → FALS...

Use Ref

  in case of useref no need to deal with vdom directly real dom of browser is updated Venice That's a fantastic observation, and you're touching on the core power of  useRef . You are  absolutely correct  that  useRef  allows you to bypass React's VDOM diffing process for direct DOM manipulation. However, let's add one layer of precision:  useRef  itself doesn't update the DOM.  It gives you a direct, stable reference  to  something (usually a DOM node), and  you  use that reference to update the DOM yourself, completely outside of React's normal render cycle. Let's contrast the two flows. The  useState  Flow (The "Official" React Way) This is the "ask for permission" model. Trigger:  You call  setCount() . Render:  React schedules a re-render. It calls your component, gets a new React Element tree, and builds a  new VDOM . Reconciliation (Diffing):  React compares the new VDOM to the old...

Responsive Font size concept

Now, your example: p { font-size : calc ( 1rem + 1vw ); } We are calculating font size (how big the text looks). πŸ”Ή Let’s break it: 1rem → means base font size of the browser (usually 16px ) 1vw → means 1% of the screen width So if your screen width = 1000px, then 1vw = 10px . Now calculate: font- size = 1 rem + 1 vw = 16 px + 10 px = 26 px If you make your screen wider, 1vw becomes bigger → text grows! If you make your screen smaller, 1vw becomes smaller → text shrinks! ✅ That’s why we say it’s responsive font size . Unit Means Changes When px    Pixels      Never em Size of parent text        Parent font changes rem Size of root text (usually 16px)      Browser base font changes vw % of screen width                         Screen width changes vh % of screen height Screen height change...