Jump to content

Welcome to CodeNameJessica

Welcome to CodeNameJessica!

💻 Where tech meets community.

Hello, Guest! 👋
You're just a few clicks away from joining an exclusive space for tech enthusiasts, problem-solvers, and lifelong learners like you.

🔐 Why Join?
By becoming a member of CodeNameJessica, you’ll get access to:
In-depth discussions on Linux, Security, Server Administration, Programming, and more
Exclusive resources, tools, and scripts for IT professionals
A supportive community of like-minded individuals to share ideas, solve problems, and learn together
Project showcases, guides, and tutorials from our members
Personalized profiles and direct messaging to collaborate with other techies

🌐 Sign Up Now and Unlock Full Access!
As a guest, you're seeing just a glimpse of what we offer. Don't miss out on the complete experience! Create a free account today and start exploring everything CodeNameJessica has to offer.

  • Entries

    141
  • Comments

    0
  • Views

    1082

Entries in this blog

by: Ryan Trimble
Mon, 10 Feb 2025 14:06:52 +0000


I’m trying to come up with ways to make components more customizable, more efficient, and easier to use and understand, and I want to describe a pattern I’ve been leaning into using CSS Cascade Layers.

I enjoy organizing code and find cascade layers a fantastic way to organize code explicitly as the cascade looks at it. The neat part is, that as much as it helps with “top-level” organization, cascade layers can be nested, which allows us to author more precise styles based on the cascade.

The only downside here is your imagination, nothing stops us from over-engineering CSS. And to be clear, you may very well consider what I’m about to show you as a form of over-engineering. I think I’ve found a balance though, keeping things simple yet organized, and I’d like to share my findings.

The anatomy of a CSS component pattern

Let’s explore a pattern for writing components in CSS using a button as an example. Buttons are one of the more popular components found in just about every component library. There’s good reason for that popularity because buttons can be used for a variety of use cases, including:

  • performing actions, like opening a drawer,
  • navigating to different sections of the UI, and
  • holding some form of state, such as focus or hover.

And buttons come in several different flavors of markup, like <button>, input[type="button"], and <a class="button">. There are even more ways to make buttons than that, if you can believe it.

On top of that, different buttons perform different functions and are often styled accordingly so that a button for one type of action is distinguished from another. Buttons also respond to state changes, such as when they are hovered, active, and focused. If you have ever written CSS with the BEM syntax, we can sort of think along those lines within the context of cascade layers.

.button {}
.button-primary {}
.button-secondary {}
.button-warning {}
/* etc. */

Okay, now, let’s write some code. Specifically, let’s create a few different types of buttons. We’ll start with a .button class that we can set on any element that we want to be styled as, well, a button! We already know that buttons come in different flavors of markup, so a generic .button class is the most reusable and extensible way to select one or all of them.

.button {
  /* Styles common to all buttons */
}

Using a cascade layer

This is where we can insert our very first cascade layer! Remember, the reason we want a cascade layer in the first place is that it allows us to set the CSS Cascade’s reading order when evaluating our styles. We can tell CSS to evaluate one layer first, followed by another layer, then another — all according to the order we want. This is an incredible feature that grants us superpower control over which styles “win” when applied by the browser.

We’ll call this layer components because, well, buttons are a type of component. What I like about this naming is that it is generic enough to support other components in the future as we decide to expand our design system. It scales with us while maintaining a nice separation of concerns with other styles we write down the road that maybe aren’t specific to components.

/* Components top-level layer */
@layer components {
  .button {
    /* Styles common to all buttons */
  }
}

Nesting cascade layers

Here is where things get a little weird. Did you know you can nest cascade layers inside classes? That’s totally a thing. So, check this out, we can introduce a new layer inside the .button class that’s already inside its own layer. Here’s what I mean:

/* Components top-level layer */
@layer components {

  .button {
    /* Component elements layer */
    @layer elements {
      /* Styles */
    }
  }
}

This is how the browser interprets that layer within a layer at the end of the day:

@layer components {
  @layer elements {
    .button {
      /* button styles... */
    }
  }
}

This isn’t a post just on nesting styles, so I’ll just say that your mileage may vary when you do it. Check out Andy Bell’s recent article about using caution with nested styles.

Structuring styles

So far, we’ve established a .button class inside of a cascade layer that’s designed to hold any type of component in our design system. Inside that .button is another cascade layer, this one for selecting the different types of buttons we might encounter in the markup. We talked earlier about buttons being <button>, <input>, or <a> and this is how we can individually select style each type.

We can use the :is() pseudo-selector function as that is akin to saying, “If this .button is an <a> element, then apply these styles.”

/* Components top-level layer */
@layer components {
  .button {
    /* Component elements layer */
    @layer elements {
      /* styles common to all buttons */

      &:is(a) {
        /* <a> specific styles */
      }

      &:is(button) {
        /* <button> specific styles */
      }

      /* etc. */
    }
  }
}

Defining default button styles

I’m going to fill in our code with the common styles that apply to all buttons. These styles sit at the top of the elements layer so that they are applied to any and all buttons, regardless of the markup. Consider them default button styles, so to speak.

/* Components top-level layer */
@layer components {
  .button {
    /* Component elements layer */
    @layer elements {
      background-color: darkslateblue;
      border: 0;
      color: white;
      cursor: pointer;
      display: grid;
      font-size: 1rem;
      font-family: inherit;
      line-height: 1;
      margin: 0;
      padding-block: 0.65rem;
      padding-inline: 1rem;
      place-content: center;
      width: fit-content;
    }
  }
}

Defining button state styles

What should our default buttons do when they are hovered, clicked, or in focus? These are the different states that the button might take when the user interacts with them, and we need to style those accordingly.

I’m going to create a new cascade sub-layer directly under the elements sub-layer called, creatively, states:

/* Components top-level layer */
@layer components {
  .button {
    /* Component elements layer */
    @layer elements {
      /* Styles common to all buttons */
    }

    /* Component states layer */
    @layer states {
      /* Styles for specific button states */
    }
  }
}

Pause and reflect here. What states should we target? What do we want to change for each of these states?

Some states may share similar property changes, such as :hover and :focus having the same background color. Luckily, CSS gives us the tools we need to tackle such problems, using the :where() function to group property changes based on the state. Why :where() instead of :is()? :where() comes with zero specificity, meaning it’s a lot easier to override than :is(), which takes the specificity of the element with the highest specificity score in its arguments. Maintaining low specificity is a virtue when it comes to writing scalable, maintainable CSS.

/* Component states layer */
@layer states {
  &:where(:hover, :focus-visible) {
    /* button hover and focus state styles */
  }
}

But how do we update the button’s styles in a meaningful way? What I mean by that is how do we make sure that the button looks like it’s hovered or in focus? We could just slap a new background color on it, but ideally, the color should be related to the background-color set in the elements layer.

So, let’s refactor things a bit. Earlier, I set the .button element’s background-color to darkslateblue. I want to reuse that color, so it behooves us to make that into a CSS variable so we can update it once and have it apply everywhere. Relying on variables is yet another virtue of writing scalable and maintainable CSS.

I’ll create a new variable called --button-background-color that is initially set to darkslateblue and then set it on the default button styles:

/* Component elements layer */
@layer elements {
  --button-background-color: darkslateblue;

  background-color: var(--button-background-color);
  border: 0;
  color: white;
  cursor: pointer;
  display: grid;
  font-size: 1rem;
  font-family: inherit;
  line-height: 1;
  margin: 0;
  padding-block: 0.65rem;
  padding-inline: 1rem;
  place-content: center;
  width: fit-content;
}

Now that we have a color stored in a variable, we can set that same variable on the button’s hovered and focused states in our other layer, using the relatively new color-mix() function to convert darkslateblue to a lighter color when the button is hovered or in focus.

Back to our states layer! We’ll first mix the color in a new CSS variable called --state-background-color:

/* Component states layer */
@layer states {
  &:where(:hover, :focus-visible) {
    /* custom property only used in state */
    --state-background-color: color-mix(
      in srgb, 
      var(--button-background-color), 
      white 10%
    );
  }
}

We can then apply that color as the background color by updating the background-color property.

/* Component states layer */
@layer states {
  &:where(:hover, :focus-visible) {
    /* custom property only used in state */
    --state-background-color: color-mix(
      in srgb, 
      var(--button-background-color), 
      white 10%
    );

    /* applying the state background-color */
    background-color: var(--state-background-color);
  }
}

Defining modified button styles

Along with elements and states layers, you may be looking for some sort of variation in your components, such as modifiers. That’s because not all buttons are going to look like your default button. You might want one with a green background color for the user to confirm a decision. Or perhaps you want a red one to indicate danger when clicked. So, we can take our existing default button styles and modify them for those specific use cases

If we think about the order of the cascade — always flowing from top to bottom — we don’t want the modified styles to affect the styles in the states layer we just made. So, let’s add a new modifiers layer in between elements and states:

/* Components top-level layer */
@layer components {

  .button {
  /* Component elements layer */
  @layer elements {
    /* etc. */
  }

  /* Component modifiers layer */
  @layer modifiers {
    /* new layer! */
  }

  /* Component states layer */
  @layer states {
    /* etc. */
  }
}

Similar to how we handled states, we can now update the --button-background-color variable for each button modifier. We could modify the styles further, of course, but we’re keeping things fairly straightforward to demonstrate how this system works.

We’ll create a new class that modifies the background-color of the default button from darkslateblue to darkgreen. Again, we can rely on the :is() selector because we want the added specificity in this case. That way, we override the default button style with the modifier class. We’ll call this class .success (green is a “successful” color) and feed it to :is():

/* Component modifiers layer */
@layer modifiers {
  &:is(.success) {
    --button-background-color: darkgreen;
  }
}

If we add the .success class to one of our buttons, it becomes darkgreen instead darkslateblue which is exactly what we want. And since we already do some color-mix()-ing in the states layer, we’ll automatically inherit those hover and focus styles, meaning darkgreen is lightened in those states.

/* Components top-level layer */
@layer components {
  .button {
    /* Component elements layer */
    @layer elements {
      --button-background-color: darkslateblue;

      background-color: var(--button-background-color);
      /* etc. */

    /* Component modifiers layer */
    @layer modifiers {
      &:is(.success) {
        --button-background-color: darkgreen;
      }
    }

    /* Component states layer */
    @layer states {
      &:where(:hover, :focus) {
        --state-background-color: color-mix(
          in srgb,
          var(--button-background-color),
          white 10%
        );

        background-color: var(--state-background-color);
      }
    }
  }
}

Putting it all together

We can refactor any CSS property we need to modify into a CSS custom property, which gives us a lot of room for customization.

/* Components top-level layer */
@layer components {
  .button {
    /* Component elements layer */
    @layer elements {
      --button-background-color: darkslateblue;

      --button-border-width: 1px;
      --button-border-style: solid;
      --button-border-color: transparent;
      --button-border-radius: 0.65rem;

      --button-text-color: white;

      --button-padding-inline: 1rem;
      --button-padding-block: 0.65rem;

      background-color: var(--button-background-color);
      border: 
        var(--button-border-width) 
        var(--button-border-style) 
        var(--button-border-color);
      border-radius: var(--button-border-radius);
      color: var(--button-text-color);
      cursor: pointer;
      display: grid;
      font-size: 1rem;
      font-family: inherit;
      line-height: 1;
      margin: 0;
      padding-block: var(--button-padding-block);
      padding-inline: var(--button-padding-inline);
      place-content: center;
      width: fit-content;
    }

    /* Component modifiers layer */
    @layer modifiers {
      &:is(.success) {
        --button-background-color: darkgreen;
      }

      &:is(.ghost) {
        --button-background-color: transparent;
        --button-text-color: black;
        --button-border-color: darkslategray;
        --button-border-width: 3px;
      }
    }

    /* Component states layer */
    @layer states {
      &:where(:hover, :focus) {
        --state-background-color: color-mix(
          in srgb,
          var(--button-background-color),
          white 10%
        );

        background-color: var(--state-background-color);
      }
    }
  }
}

P.S. Look closer at that demo and check out how I’m adjusting the button’s background using light-dark() — then go read Sara Joy’s “Come to the light-dark() Side” for a thorough rundown of how that works!


What do you think? Is this something you would use to organize your styles? I can see how creating a system of cascade layers could be overkill for a small project with few components. But even a little toe-dipping into things like we just did illustrates how much power we have when it comes to managing — and even taming — the CSS Cascade. Buttons are deceptively complex but we saw how few styles it takes to handle everything from the default styles to writing the styles for their states and modified versions.


Organizing Design System Component Patterns With CSS Cascade Layers originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

by: Geoff Graham
Mon, 10 Feb 2025 13:54:00 +0000


From MacRumors:

Stationery Pad is a handy way to nix a step in your workflow if you regularly use document templates on your Mac. The long-standing Finder feature essentially tells a file’s parent application to open a copy of it by default, ensuring that the original file remains unedited.

This works for any kind of file, including HTML, CSS, JavaScriprt, or what have you. You can get there with CMD+i or right-click and select “Get info.”

macOS contextual window for a CSS file with the "Stationary pad" checkbox option highlighted.

Make Any File a Template Using This Hidden macOS Tool originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

by: Geoff Graham
Mon, 10 Feb 2025 13:54:00 +0000


From MacRumors:

Stationery Pad is a handy way to nix a step in your workflow if you regularly use document templates on your Mac. The long-standing Finder feature essentially tells a file’s parent application to open a copy of it by default, ensuring that the original file remains unedited.

This works for any kind of file, including HTML, CSS, JavaScriprt, or what have you. You can get there with CMD+i or right-click and select “Get info.”

macOS contextual window for a CSS file with the "Stationary pad" checkbox option highlighted.

Make Any File a Template Using This Hidden macOS Tool originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

by: Chirag Manghnani
Sun, 09 Feb 2025 18:46:00 +0000


Are you looking for a list of the best chairs for programming?

Here, in this article, we have come up with a list of the 10 best chairs for programming in India since we care for your wellbeing.

You almost spend much of the workday sitting in a chair as a programmer, software developer, software engineer, or tester. Programming is a tough job, especially for the back in particular. You spend your whole life at a desk staring at the code and finding the errors, right. So, it is highly essential for your job and wellbeing that you get a very convenient and ergonomic chair.

Computer work has transcendent advantages and opportunities but takes much attention. Programmers can create new and innovative projects but also have to work correctly. People are more likely to get distracted if they complain about back pain and have a poor stance.

Undoubtedly, you can work anywhere, whether seated or in a standing posture, with a laptop. With work from home rising as a new trend and the need, for now, people have molded themselves to work accordingly. However, these choices don’t necessarily build the best environment for coding and other IT jobs. 

Why Do You Need a Good Chair?

You can physically sense the effects of operating from a chair if you have programmed for some amount of time. It would help if you never neglected which chair you’re sitting on, as it can contribute to the back, spine, elbows, knees, hips, and even circulation problems.

Most programmers and developers work at desks and sometimes suffer from several health problems, such as spinal disorders, maladaptation of the spine, and hernia. These complications commonly result from the long-term sitting on a poor-quality chair.

Traditional chairs do generally not embrace certain structural parts of the body, such as the spine, spine, legs, and arms, leading to dolor, stiffness, and muscle pain. Not only can an ergonomic office chair be velvety and cozy but ergonomically built to protect the backrest and arm to prevent health problems.

So, it is essential not only for programmers but also for those who work 8-10 hours on a computer to get a good chair for the correct seating and posture. 

So, let’s get started!

Before moving to the list of chairs directly, let us first understand the factors that one should be looking at before investing in the ideal chair.

Also Read: 10 Best Laptops for Programming in India

Best Chairs for Programming in India  

Factors for Choosing Best Chair for Programming

Here are the three most important factors that you should know when buying an ergonomic chair:

Material of Chair

Always remember, don’t just go with the appearance and design of the chair. The chair may look spectacular, but it may not have the materials to make you feel pleasant and comfortable in the long run. At the time of purchasing a chair, make sure you have sufficient knowledge of the material used to build a chair. 

Seat Adjustability

The advantage of adjusting the chair is well-known by the people who have suffered back pain and other issues with a traditional chair that lack adjustability. When looking for a good chair, seat height, armrest, backrest, and rotation are some of the few aspects that should be considered. 

Chair Structure

This is one of the most crucial points every programmer should look at, as the correct structure of the chair leads to the better posture of your spine, eliminating back pain, spine injury, and hip pain, and others.

10 Best Chairs for Programming in India

Green Soul Monster Ultimate (S)

Best Chairs for Programming

Green Soul Monster Ultimate (S) is multi-functional, ergonomic, and one of the best chairs for programming. Besides, this chair is also a perfect match for pro gamers with utmost comfort, excellent features, and larger size. It comes in two sizes, ‘S’ suitable for height 5ft.2″ to 5ft.10″ and ‘T’ for 5ft.8″ to 6ft.5″.

In addition, the ultimate monster chair comes with premium soft and breathable tissue that provides airflow to keep the air moving on your back to improve the airflow, avoiding heat accumulation. Also, the chair comes with a three years manufacturing warranty. 

Features:

  • Metal internal frame material, large frame size, and spandex fabric with PU leather
  • Neck/head pillow, lumbar pillow, and molded type foam made of velour material
  • Any position lock, adjustable backrest angle of 90-180 degrees, and deer mechanism
  • Rocking range of approx 15 degrees, 60mm dual caster wheels, and heavy-duty metal base

Amazon Rating: 4.6/5

buy now

CELLBELL Ergonomic Chair

Cellbell CG03

CELLBELL Gaming Chair is committed to making the best gaming and programming chair for professionals with a wide seating space. The arms of this chair are ergonomically designed and have a height-adjustable Up and Down PU padded armrest.

The chair also comes with adjustable functions to adapt to various desk height and sitting positions. It consists of highly durable PU fabric, with height adjustment and a removable headrest. It has a high backrest that provides good balance as well as back and neck support.

Features:

  • Reclining backrest from 90 to 155 degrees, 7cm height adjust armrest, and 360-degree swivel
  • Lumbar cushion for comfortable seating position and lumbar massage support
  • Durable casters for smooth rolling and gliding
  • Ergonomic design with adjustable height Up and Down PU padded armrest

Amazon Rating: 4.7/5

buy now

Green Soul Seoul Mid Back Office Study Chair

Green Soul Seol

The Simple Designed Mid mesh chair, Green Soul, allows breathing and back and thighs to be supported when operating for extended hours. The chair is fitted with a high-level height control feature that includes a smooth and long-term hydraulic piston.

Additionally, the chair also boasts a rocking mode that allows enhanced relaxation, tilting the chair between 90 to 105 degrees. A tilt-in friction knob under the char makes rocking back smoother.

Features:

  • Internal metal frame, head/neck support, lumbar support, and push back mechanism
  • Back upholstery mesh material, nylon base, 50mm dual castor wheels, and four different color options
  • Height adjustment, Torsion Knob, comfortable tilt, and breathable mesh
  • Pneumatic control, 360-degree swivel, lightweight, and thick molded foam seat

Amazon Rating: 4.3/5

buy now

CELLBELL C104 Medium-Back Mesh Office Chair

Best Chairs for Programming1

This chair provides extra comfort to users with an extended seating time through breathable comfort mesh that gives additional support for the lumbar. Its ergonomic backrest design fits the spine curve, reducing the pressure and back pain, enhancing more comfort.

Features:

  • Silent casters with 360-degree spin, Breathable mesh back, and streamlined design for the best spine fit
  • Thick padded seat, Pneumatic Hydraulic for seat Height adjustment, and heavy-duty metal base
  • Tilt-back up to 120 degrees, 360 degrees swivel, control handle, and high-density resilient foam
  • Sturdy plastic armrest, lightweight, and budget-friendly

Amazon Rating: 4.4/5

buy now

INNOWIN Jazz High Back Mesh Office Chair

Innowin Jazz

Another best chair for programming and gaming is INNOWIN Jazz high chair, ideal for people having height below 5.8″. The chair is highly comfortable and comes with ergonomic lumbar support and a glass-filled nylon structure with breathable mesh. 

The chair offers the height adjustability of the arms that allows users with different heights to find the correct posture for their body. The lumbar support on this chair provides proper back support for prolonged usage, reducing back pain.

Features:

  • Innovative any position lock system, in-built adjustable headrest, and 60 mm durable casters with a high load capacity
  • Height-adjustable arms, glass-filled nylon base, high-quality breathable mesh, and class 3 gas lift 
  • 45 density molded seat, sturdy BIFMA certified nylon base, and synchro mechanism

Amazon Rating: 4.4/5

buy now

Green Soul Beast Series Chair

Green Soul Beast

Features:

  • Adjustable lumbar pillow, headrest, racing car bucket seat, and neck/head support
  • Adjustable 3D armrest, back support, shoulder and arms support, thighs and knees support
  • Breathable cool fabric and PU leather, molded foam, butterfly mechanism, and rocking pressure adjustor
  • Adjustable back angle between 90 to 180 degrees, 60mm PU wheels, nylon base, and 360-degree swivel

Amazon Rating: 4.5/5

buy now

Green Soul New York Chair

Best Chairs for Programming Green Soul NewYork

The New York chair has a mesh for respiration and a professional and managerial design that ensures relaxation for a day long. This chair is one the best chairs for programming with a knee tilt to relax at any position between 90 to 105 degrees.

Moreover, High Back Green Soul New York Ergonomically built Mesh Office Chair offers the correct stance and supports the body thoroughly. The airy mesh keeps your rear calm and relaxed during the day.

Features:

  • Breathable mesh, Height adjustment, 360-degree swivel, and ultra-comfortable cushion
  • Nylon and glass frame material, adjustable headrest and seat height, and any position tilt lock
  • Fully adjustable lumbar support, T-shaped armrests, thick molded foam, and heavy-duty metal base 

Amazon Rating: 4.2/5

buy now

FURNICOM Office/Study/Revolving Computer Chair

Furnicom Chair

This office chair has high-quality soft padding on the back and thick molded foam, and the fabric polishing on this seat also supports the build-up of heat and moisture to keep your entire body calm and relaxed. It is also easier to lift or lower the chair with pneumatic control. The chair features a padded seat as well as the back, which offers long-day sheer comfort.

Features:

  • Spine shaped design, breathable fabric upholstery, durable lever, and personalized height adjustment
  • Rocking side tilt, 360-degree swivel, heavy metal base, torsion knob, and handles for comfort
  • Rotational wheels, thick molded foam on seat, and soft molded foam on the back

Amazon Rating: 4.2/5

buy now

INNOWIN Pony Mid Back Office Chair

Best Chairs for Programming Innowin Pony

Features:

  • Any position lock system, glass-filled nylon base, and class 3 gas lift
  • Breathable mesh for a sweat-free backrest, 50 mm durable casters with a high load capacity, and 45 density molded seat
  • Adjustable headrest, height-adjustable arms, lumbar support for up and down movement
  • Minimalist design, Sturdy BIFMA certified nylon base, and synchro mechanism with 122 degrees tilt

Amazon Rating: 4.3/5

buy now

CELLBELL C103 Medium-Back Mesh Office Chair

Cellbell C103

Features:

  • Silent casters with 360-degree spin, Breathable mesh back, and streamlined design for the best spine fit
  • Thick padded seat, Pneumatic Hydraulic for seat Height adjustment, and heavy-duty metal base
  • Tilt-back up to 120 degrees, 360 degrees swivel, control handle, and high-density resilient foam
  • Sturdy plastic armrest, lightweight, and budget-friendly

Amazon Rating: 4.4/5

buy now

Conclusion

Finding a suitable chair for yourself with all the features is not hard, But what more important is which chair you go with from so many available options. To help you with that, we have curated the list of ten best chairs for programming in India. 

Buying a perfect ergonomic chair is highly essential, especially in times when the pandemic is rising, and the new normal work from home is elevated. We highly suggest that no one should be work sitting/lying on a bed, on the couch, or in any position that may affect your health. It will help if you go with an ideal chair to keep your body posture correct, reducing body issues and increasing work efficiency.

Please share your valuable comments regarding the list of best chairs for programming.

Cheers to healthy work life!

The post 10 Best Chairs for Programming in India 2025 appeared first on The Crazy Programmer.

by: Suraj Kumar
Fri, 07 Feb 2025 16:20:00 +0000


What is NoSQL, and what are the best NoSQL databases? These are the common questions that most companies and developers usually ask. Nowadays, the requirements for NoSQL databases are increasing as the traditional relational databases are not enough to handle the current requirements of the management.

It is because now the companies have millions of customers and their details. Handling this colossal data is tough; hence it requires NoSQL. These databases are more agile and provide scalable features; also, they are a better choice to handle the vast data of the customers and find crucial insights.

Thus, in this article, we will find out the best  NoSQL databases with the help of our list.

What is NoSQL Database?

If you belong to the data science field, you may have heard that NoSQL databases are non-relational databases. This may sound unclear, and it can become challenging to understand if you are just a fresher in this field.

The NoSQL is the short representation of the Not Only SQL that may also mean it can handle relational databases. In this database, the data does not split into many other tables. It keeps it related in any way to make a single data structure. Thus, when there is vast data, the user does not have to experience the user lag. They also do not need to hire costly professionals who use critical techniques to present these data in the simplest form. But for this, the company needs to choose the best NoSQL database, and professionals also need to learn the same.

8 Best NoSQL Databases in 2024

1. Apache HBase

Apache HBase

Apache HBase is an open-source database, and it is a kind of Hadoop database. Its feature is that it can easily read and write the vast data that a company has stored. It is designed to handle the billions of rows and columns of the company’s data. This database is based on a big table: a distribution warehouse or data collection system developed to structure the data the company receives.

This is in our list of best NoSQL databases because it has the functionality of scalability, consistent reading of data, and many more.

2. MongoDB

MongoDB

MongoDB is also a great database based on general-purpose distribution and mainly developed for the developers who use the database for the cloud. It stores the data in documents such as JSON. It is a much powerful and efficient database available in the market. MongoDB supports various methods and techniques to analyze and interpret the data. You can search the graphs, text, and any geographical search. If you use it, then you also get an added advantage of high-level security of SSL, encryption, and firewalls. Thus it can also be the best NoSQL database to consider for your business and learning purpose.

3. Apache CouchDB

Apache CouchDB

If you are looking for a database that offers easy access and storage features, you can consider Apache CouchDB. It is a single node database, and you can also get it for free as it is open source. You can also scale it when you think it fits, and it can store your data in the cluster of nodes and multiple the available servers. It has JSON data format support and an HTTP protocol that can integrate with the HTTP proxy of the servers. It is also a secure database that you can choose from because it is designed considering the crash-resistant feature.

4. Apache Cassandra

Apache Cassandra

Apache Cassandra is another beautiful open source and NoSQL database available currently. It was initially developed by Facebook but also got a promotion from Google. This database is available almost everywhere and also can scale as per the requirements of the users. It can smoothly handle the thousands of concurrent data requests every second and also handle the petabyte information or data. Including Facebook, Netflix, Coursera, and Instagram, more than 400 companies use Apache Cassandra NoSQL database.

5. OrientDB

OrientDB

It is also an ideal and open source NoSQL database that supports various models like a graph, document, and value model. This database is written in the programming language Java. It can show the relationship between managed records and the graph. It is a reliable and secure database suitable for large customer base users as well. Moreover, its graph edition is capable of visualizing and interacting with extensive data.

6. RavenDB

RavenDB

RavenDB is a database that is based on the document format and has features of NoSQL. You can also use its ACID feature that ensures data integrity. It is a scalable database, and hence if you think your customer base is getting huge in millions, you can scale it as well. You can install it on permission and also use it in the cloud format with the cloud services offered by Azure and Web Services of Amazon.

7. Neo4j

Neo4j

If you were searching for a NoSQL database that can handle not only the data. But also a real relationship between them, then it is the perfect database for you. With this database, you can store the data safely and re-access those in such a fast and inconvenient manner. Every data stored contains a unique pointer. In this database, you also get the feature of Cypher Queries that gives you a much faster experience.

8. Hypertable

Hypertable

Hypertable is also a NoSQL and open source database that is scalable and can appear in almost all relational DBs. It was mainly developed to solve scalability, and it is based on the Google Big Table. This database was written in the C++ programming language, and you can use it in Mac OS and Linux. It is suitable for managing big data and can use various techniques to short the available data. It can be a great choice if you expect to get maximum efficiency and cost efficiency from the database.

Conclusion

Thus, in this article, we learned about some best NoSQL databases and those that are secure, widely available, widely used, and open source. Here we discussed the database, including MongoDB, OrientDB, Apache HBase, and Apache Cassandra. So, if you like this list of best NoSQL databases, comment down and mention the name of the NoSQL database that you think we have missed and that should be included.

The post 8 Best NoSQL Databases in 2025 appeared first on The Crazy Programmer.

by: Vishal Yadav
Fri, 07 Feb 2025 08:56:00 +0000


In this article, you will find some best free HTML cheat sheets, which include all of the key attributes for lists, forms, text formatting, and document structure. Additionally, we will show you an image preview of the HTML cheat sheet. 

What is HTML?

HTML (Hyper Text Markup Language) is a markup language used to develop web pages. This language employs HTML elements to arrange web pages so that they will have a header, body, sidebar, and footer. HTML tags can also format text, embed images or attributes, make lists, and connect to external files. The last function allows you to change the page’s layout by including CSS files and other objects. 

It is crucial to utilize proper HTML tags as an incorrect structure may break the web page. Worse, search engines may be unable to read the information provided within the tags.

As HTML has so many tags, we have created a helpful HTML cheat sheet to assist you in using the language. 

5 Best HTML Cheat Sheets

HTML Cheat Sheets

Bluehost.com

Bluehost’s website provides this informative infographic with some basic HTML and CSS coding information. The guide defines and explains the definitions and fundamental applications of HTML, CSS, snippets, tags, and hyperlinks. The graphic includes examples of specific codes that can be used to develop different features on a website.

Link: https://www.bluehost.com/resources/html-css-cheat-sheet-infographic/

cheat-sheets.org

This cheat sheet does an excellent job of summarising numerous common HTML code tags on a single page. There are tables for fundamental elements such as forms, text markups, tables, and objects. It is posted as an image file on the cheat-sheets.org website, making it simple to print or save the file for future reference. It is an excellent resource for any coder who wants a quick look at the basics.

Link:  http://www.cheat-sheets.org/saved-copy/html-cheat-sheet.png

Codeacademy.com

The HTML cheat sheet from Codecademy is an easy-to-navigate, easy-to-understand guide to everything HTML. It has divided into sections such as Elements and Structure, Tables, Forms, and Semantic HTML, making it simple to discover the code you need to write just about anything in HTML. It also contains an explanation of each tag and how to utilize it. This cheat sheet is also printable if you prefer a hard copy to refer to while coding.

Link: https://www.codecademy.com/learn/learn-html/modules/learn-html-elements/cheatsheet

Digital.com

The Digital website’s HTML cheat sheet is an excellent top-down reference for all key HTML tags included in the HTML5 standard. The sheet begins with explaining essential HTML components, followed by ten sections on content embedding and metadata. Each tag has a description, related properties, and a coding sample that shows how to use it.

Link: https://digital.com/tools/html-cheatsheet/

websitesetup.org

This basic HTML cheat sheet is presented as a single page that is easy to understand. Half of the data on this sheet is devoted to table formatting, with a detailed example of how to use these components. They also provide several download alternatives for the cheat sheet, including a colour PDF, a black and white PDF, and a JPG image file.

Link: https://websitesetup.org/html5-cheat-sheet/

I hope this article has given you a better understanding of what an HTML cheat sheet is. The idea was to provide our readers with a quick reference guide to various frequently used HTML tags. If you have any queries related to HTML Cheat Sheets, please let us know in the comment section below. 

The post 5 Best HTML Cheat Sheets 2025 appeared first on The Crazy Programmer.

Blogger

ContractCrab

by: aiparabellum.com
Fri, 07 Feb 2025 08:38:37 +0000


ContractCrab is an innovative AI-driven platform designed to simplify and revolutionize the way businesses handle contract reviews. By leveraging advanced artificial intelligence, this tool enables users to review contracts in just one click, significantly improving negotiation processes and saving both time and resources. Whether you are a legal professional, a business owner, or an individual needing efficient contract management, ContractCrab ensures accuracy, speed, and cost-effectiveness in handling your legal documents.

Features of ContractCrab

ContractCrab offers a wide range of features that cater to varied contract management needs:

  1. AI Contract Review: Automatically analyze contracts for key clauses and potential risks.
  2. Contract Summarizer: Generate concise summaries to focus on the essential points.
  3. AI Contract Storage: Securely store contracts with end-to-end encryption.
  4. Contract Extraction: Extract key information and clauses from lengthy documents.
  5. Legal Automation: Automate repetitive legal processes for enhanced efficiency.
  6. Specialized Reviews: Provides tailored reviews for employment contracts, physician agreements, and more.

These features are designed to reduce manual effort, improve contract comprehension, and ensure legal accuracy.

How It Works

Using ContractCrab is straightforward and user-friendly:

  1. Upload the Contract: Begin by uploading your document in .pdf, .docx, or .txt format.
  2. Review the Details: The AI analyzes the content, identifies redundancies, and highlights key sections.
  3. Manage the Changes: Accept or reject AI-suggested modifications to suit your requirements.
  4. Enjoy the Result: Receive a concise, legally accurate contract summary within seconds.

This seamless process ensures that contracts are reviewed quickly and effectively, saving you time and effort.

Benefits of ContractCrab

ContractCrab provides numerous advantages to its users:

  • Time-Saving: Complete contract reviews in seconds instead of days.
  • Cost-Effective: With pricing as low as $3 per hour, it is far more affordable than hiring legal professionals.
  • Accuracy: Eliminates human errors caused by fatigue or inattention.
  • 24/7 Availability: Accessible anytime, eliminating scheduling constraints.
  • Enhanced Negotiations: Streamlines the process, enabling users to focus on critical aspects of agreements.
  • Data Security: Ensures end-to-end encryption and regular data backups for maximum protection.

These benefits make ContractCrab an indispensable tool for businesses and individuals alike.

Pricing

ContractCrab offers competitive and transparent pricing plans:

  • Starting at $3 per hour: Ideal for quick and efficient reviews.
  • Monthly Subscription at $30: Provides unlimited access to all features.

This affordability ensures that businesses of all sizes can leverage the platform’s advanced AI capabilities without overspending.

Review

ContractCrab has received positive feedback from professionals and users across industries:

  • Ellen Hernandez, Contract Manager: “The most attractive pricing on the legal technology market. Excellent value for the features provided.”
  • William Padilla, Chief Security Officer: “Promising project ahead. Looking forward to the launch!”
  • Jonathan Quinn, Personal Assistant: “Top-tier process automation. It’s great to pre-check any document before it moves to the next step.”

These testimonials highlight ContractCrab’s potential to transform contract management with its advanced features and affordability.

Conclusion

ContractCrab stands out as a cutting-edge solution for AI-powered contract review, offering exceptional accuracy, speed, and cost-efficiency. Its user-friendly interface and robust features cater to diverse needs, making it an indispensable tool for businesses and individuals. With pricing as low as $3 per hour, ContractCrab ensures accessibility without compromising quality. Whether you are managing employment contracts, legal agreements, or construction documents, this platform simplifies the process, enhances readability, and mitigates risks effectively.

The post ContractCrab appeared first on AI Parabellum.

Blogger

ContractCrab

by: aiparabellum.com
Fri, 07 Feb 2025 08:38:37 +0000


ContractCrab is an innovative AI-driven platform designed to simplify and revolutionize the way businesses handle contract reviews. By leveraging advanced artificial intelligence, this tool enables users to review contracts in just one click, significantly improving negotiation processes and saving both time and resources. Whether you are a legal professional, a business owner, or an individual needing efficient contract management, ContractCrab ensures accuracy, speed, and cost-effectiveness in handling your legal documents.

Features of ContractCrab

ContractCrab offers a wide range of features that cater to varied contract management needs:

  1. AI Contract Review: Automatically analyze contracts for key clauses and potential risks.
  2. Contract Summarizer: Generate concise summaries to focus on the essential points.
  3. AI Contract Storage: Securely store contracts with end-to-end encryption.
  4. Contract Extraction: Extract key information and clauses from lengthy documents.
  5. Legal Automation: Automate repetitive legal processes for enhanced efficiency.
  6. Specialized Reviews: Provides tailored reviews for employment contracts, physician agreements, and more.

These features are designed to reduce manual effort, improve contract comprehension, and ensure legal accuracy.

How It Works

Using ContractCrab is straightforward and user-friendly:

  1. Upload the Contract: Begin by uploading your document in .pdf, .docx, or .txt format.
  2. Review the Details: The AI analyzes the content, identifies redundancies, and highlights key sections.
  3. Manage the Changes: Accept or reject AI-suggested modifications to suit your requirements.
  4. Enjoy the Result: Receive a concise, legally accurate contract summary within seconds.

This seamless process ensures that contracts are reviewed quickly and effectively, saving you time and effort.

Benefits of ContractCrab

ContractCrab provides numerous advantages to its users:

  • Time-Saving: Complete contract reviews in seconds instead of days.
  • Cost-Effective: With pricing as low as $3 per hour, it is far more affordable than hiring legal professionals.
  • Accuracy: Eliminates human errors caused by fatigue or inattention.
  • 24/7 Availability: Accessible anytime, eliminating scheduling constraints.
  • Enhanced Negotiations: Streamlines the process, enabling users to focus on critical aspects of agreements.
  • Data Security: Ensures end-to-end encryption and regular data backups for maximum protection.

These benefits make ContractCrab an indispensable tool for businesses and individuals alike.

Pricing

ContractCrab offers competitive and transparent pricing plans:

  • Starting at $3 per hour: Ideal for quick and efficient reviews.
  • Monthly Subscription at $30: Provides unlimited access to all features.

This affordability ensures that businesses of all sizes can leverage the platform’s advanced AI capabilities without overspending.

Review

ContractCrab has received positive feedback from professionals and users across industries:

  • Ellen Hernandez, Contract Manager: “The most attractive pricing on the legal technology market. Excellent value for the features provided.”
  • William Padilla, Chief Security Officer: “Promising project ahead. Looking forward to the launch!”
  • Jonathan Quinn, Personal Assistant: “Top-tier process automation. It’s great to pre-check any document before it moves to the next step.”

These testimonials highlight ContractCrab’s potential to transform contract management with its advanced features and affordability.

Conclusion

ContractCrab stands out as a cutting-edge solution for AI-powered contract review, offering exceptional accuracy, speed, and cost-efficiency. Its user-friendly interface and robust features cater to diverse needs, making it an indispensable tool for businesses and individuals. With pricing as low as $3 per hour, ContractCrab ensures accessibility without compromising quality. Whether you are managing employment contracts, legal agreements, or construction documents, this platform simplifies the process, enhances readability, and mitigates risks effectively.

The post ContractCrab appeared first on AI Parabellum.

by: Geoff Graham
Thu, 06 Feb 2025 15:29:35 +0000


A little gem from Kevin Powell’s “HTML & CSS Tip of the Week” website, reminding us that using container queries opens up container query units for sizing things based on the size of the queried container.

cqi and cqb are similar to vw and vh, but instead of caring about the viewport, they care about their containers size.

cqi is your inline-size unit (usually width in horizontal writing modes), while cqbhandles block-size (usually height).

So, 1cqi is equivalent to 1% of the container’s inline size, and 1cqb is equal to 1% of the container’s block size. I’d be remiss not to mention the cqmin and cqmax units, which evaluate either the container’s inline or block size. So, we could say 50cqmax and that equals 50% of the container’s size, but it will look at both the container’s inline and block size, determine which is greater, and use that to calculate the final computed value.

1200px by 500px rectangle showing that 50cqmax is equal to 50% of the larger size.

That’s a nice dash of conditional logic. It can help maintain proportions if you think the writing mode might change on you, such as moving from horizontal to vertical.


Container query units: cqi and cqb originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

by: Geoff Graham
Wed, 05 Feb 2025 14:58:18 +0000


You know about Baseline, right? And you may have heard that the Chrome team made a web component for it.

Here it is!

Of course, we could simply drop the HTML component into the page. But I never know where we’re going to use something like this. The Almanac, obs. But I’m sure there are times where embedded it in other pages and posts makes sense.

That’s exactly what WordPress blocks are good for. We can take an already reusable component and make it repeatable when working in the WordPress editor. So that’s what I did! That component you see up there is the <baseline-status> web component formatted as a WordPress block. Let’s drop another one in just for kicks.

Pretty neat! I saw that Pawel Grzybek made an equivalent for Hugo. There’s an Astro equivalent, too. Because I’m fairly green with WordPress block development I thought I’d write a bit up on how it’s put together. There are still rough edges that I’d like to smooth out later, but this is a good enough point to share the basic idea.

Scaffolding the project

I used the @wordpress/create-block package to bootstrap and initialize the project. All that means is I cd‘d into the /wp-content/plugins directory from the command line and ran the install command to plop it all in there.

npm install @wordpress/create-block
Mac Finder window with the WordPress plugins directory open and showing the baseline-status plugin folder.
The command prompts you through the setup process to name the project and all that.

The baseline-status.php file is where the plugin is registered. And yes, it’s looks completely the same as it’s been for years, just not in a style.css file like it is for themes. The difference is that the create-block package does some lifting to register the widget so I don’t have to:

<?php
/**
 * Plugin Name:       Baseline Status
 * Plugin URI:        https://css-tricks.com
 * Description:       Displays current Baseline availability for web platform features.
 * Requires at least: 6.6
 * Requires PHP:      7.2
 * Version:           0.1.0
 * Author:            geoffgraham
 * License:           GPL-2.0-or-later
 * License URI:       https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain:       baseline-status
 *
 * @package CssTricks
 */

if ( ! defined( 'ABSPATH' ) ) {
  exit; // Exit if accessed directly.
}

function csstricks_baseline_status_block_init() {
  register_block_type( __DIR__ . '/build' );
}
add_action( 'init', 'csstricks_baseline_status_block_init' );

?>

The real meat is in src directory.

Mac Finder window with the WordPress project's src folder open with seven files, two are highlighted in orange: edit.js and render.php.

The create-block package also did some filling of the blanks in the block-json file based on the onboarding process:

{
  "$schema": "https://schemas.wp.org/trunk/block.json",
  "apiVersion": 2,
  "name": "css-tricks/baseline-status",
  "version": "0.1.0",
  "title": "Baseline Status",
  "category": "widgets",
  "icon": "chart-pie",
  "description": "Displays current Baseline availability for web platform features.",
  "example": {},
  "supports": {
    "html": false
  },
  "textdomain": "baseline-status",
  "editorScript": "file:./index.js",
  "editorStyle": "file:./index.css",
  "style": "file:./style-index.css",
  "render": "file:./render.php",
  "viewScript": "file:./view.js"
}

Going off some tutorials published right here on CSS-Tricks, I knew that WordPress blocks render twice — once on the front end and once on the back end — and there’s a file for each one in the src folder:

  • render.php: Handles the front-end view
  • edit.js: Handles the back-end view

The front-end and back-end markup

Cool. I started with the <baseline-status> web component’s markup:

<script src="https://cdn.jsdelivr.net/npm/baseline-status@1.0.8/baseline-status.min.js" type="module"></script>
<baseline-status featureId="anchor-positioning"></baseline-status>

I’d hate to inject that <script> every time the block pops up, so I decided to enqueue the file conditionally based on the block being displayed on the page. This is happening in the main baseline-status.php file which I treated sorta the same way as a theme’s functions.php file. It’s just where helper functions go.

// ... same code as before

// Enqueue the minified script
function csstricks_enqueue_block_assets() {
  wp_enqueue_script(
    'baseline-status-widget-script',
    'https://cdn.jsdelivr.net/npm/baseline-status@1.0.4/baseline-status.min.js',
    array(),
    '1.0.4',
    true
  );
}
add_action( 'enqueue_block_assets', 'csstricks_enqueue_block_assets' );

// Adds the 'type="module"' attribute to the script
function csstricks_add_type_attribute($tag, $handle, $src) {
  if ( 'baseline-status-widget-script' === $handle ) {
    $tag = '<script type="module" src="' . esc_url( $src ) . '"></script>';
  }
  return $tag;
}
add_filter( 'script_loader_tag', 'csstricks_add_type_attribute', 10, 3 );

// Enqueues the scripts and styles for the back end
function csstricks_enqueue_block_editor_assets() {
  // Enqueues the scripts
  wp_enqueue_script(
    'baseline-status-widget-block',
    plugins_url( 'block.js', __FILE__ ),
    array( 'wp-blocks', 'wp-element', 'wp-editor' ),
    false,
  );

  // Enqueues the styles
  wp_enqueue_style(
    'baseline-status-widget-block-editor',
    plugins_url( 'style.css', __FILE__ ),
    array( 'wp-edit-blocks' ),
    false,
  );
}
add_action( 'enqueue_block_editor_assets', 'csstricks_enqueue_block_editor_assets' );

The final result bakes the script directly into the plugin so that it adheres to the WordPress Plugin Directory guidelines. If that wasn’t the case, I’d probably keep the hosted script intact because I’m completely uninterested in maintaining it. Oh, and that csstricks_add_type_attribute() function is to help import the file as an ES module. There’s a wp_enqueue_script_module() action available to hook into that should handle that, but I couldn’t get it to do the trick.

With that in hand, I can put the component’s markup into a template. The render.php file is where all the front-end goodness resides, so that’s where I dropped the markup:

<baseline-status
  <?php echo get_block_wrapper_attributes(); ?> 
  featureId="[FEATURE]">
</baseline-status>

That get_block_wrapper_attibutes() thing is recommended by the WordPress docs as a way to output all of a block’s information for debugging things, such as which features it ought to support.

[FEATURE]is a placeholder that will eventually tell the component which web platform to render information about. We may as well work on that now. I can register attributes for the component in block.json:

"attributes": { "showBaselineStatus": {
  "featureID": {
  "type": "string"
  }
},

Now we can update the markup in render.php to echo the featureID when it’s been established.

<baseline-status
  <?php echo get_block_wrapper_attributes(); ?> 
  featureId="<?php echo esc_html( $featureID ); ?>">
</baseline-status>

There will be more edits to that markup a little later. But first, I need to put the markup in the edit.js file so that the component renders in the WordPress editor when adding it to the page.

<baseline-status { ...useBlockProps() } featureId={ featureID }></baseline-status>

useBlockProps is the JavaScript equivalent of get_block_wrapper_attibutes() and can be good for debugging on the back end.

At this point, the block is fully rendered on the page when dropped in! The problems are:

  • It’s not passing in the feature I want to display.
  • It’s not editable.

I’ll work on the latter first. That way, I can simply plug the right variable in there once everything’s been hooked up.

Block settings

One of the nicer aspects of WordPress DX is that we have direct access to the same controls that WordPress uses for its own blocks. We import them and extend them where needed.

I started by importing the stuff in edit.js:

import { InspectorControls, useBlockProps } from '@wordpress/block-editor';
import { PanelBody, TextControl } from '@wordpress/components';
import './editor.scss';

This gives me a few handy things:

  • InspectorControls are good for debugging.
  • useBlockProps are what can be debugged.
  • PanelBody is the main wrapper for the block settings.
  • TextControl is the field I want to pass into the markup where [FEATURE] currently is.
  • editor.scss provides styles for the controls.

Before I get to the controls, there’s an Edit function needed to use as a wrapper for all the work:

export default function Edit( { attributes, setAttributes } ) {
  // Controls
}

First is InspectorTools and the PanelBody:

export default function Edit( { attributes, setAttributes } ) {
  // React components need a parent element
  <>
    <InspectorControls>
      <PanelBody title={ __( 'Settings', 'baseline-status' ) }>
      // Controls
      </PanelBody>
    </InspectorControls>
  </>
}

Then it’s time for the actual text input control. I really had to lean on this introductory tutorial on block development for the following code, notably this section.

export default function Edit( { attributes, setAttributes } ) {
  <>
    <InspectorControls>
      <PanelBody title={ __( 'Settings', 'baseline-status' ) }>
        // Controls
        <TextControl
          label={ __(
            'Feature', // Input label
            'baseline-status'
          ) }
          value={ featureID || '' }
          onChange={ ( value ) =>
            setAttributes( { featureID: value } )
          }
        />
     </PanelBody>
    </InspectorControls>
  </>
}

Tie it all together

At this point, I have:

  • The front-end view
  • The back-end view
  • Block settings with a text input
  • All the logic for handling state

Oh yeah! Can’t forget to define the featureID variable because that’s what populates in the component’s markup. Back in edit.js:

const { featureID } = attributes;

In short: The feature’s ID is what constitutes the block’s attributes. Now I need to register that attribute so the block recognizes it. Back in block.json in a new section:

"attributes": {
  "featureID": {
    "type": "string"
  }
},

Pretty straightforward, I think. Just a single text field that’s a string. It’s at this time that I can finally wire it up to the front-end markup in render.php:

<baseline-status
  <?php echo get_block_wrapper_attributes(); ?>
  featureId="<?php echo esc_html( $featureID ); ?>">
</baseline-status>

Styling the component

I struggled with this more than I care to admit. I’ve dabbled with styling the Shadow DOM but only academically, so to speak. This is the first time I’ve attempted to style a web component with Shadow DOM parts on something being used in production.

If you’re new to Shadow DOM, the basic idea is that it prevents styles and scripts from “leaking” in or out of the component. This is a big selling point of web components because it’s so darn easy to drop them into any project and have them “just” work.

But how do you style a third-party web component? It depends on how the developer sets things up because there are ways to allow styles to “pierce” through the Shadow DOM. Ollie Williams wrote “Styling in the Shadow DOM With CSS Shadow Parts” for us a while back and it was super helpful in pointing me in the right direction. Chris has one, too.

A few other more articles I used:

First off, I knew I could select the <baseline-status> element directly without any classes, IDs, or other attributes:

baseline-status {
  /* Styles! */
}

I peeked at the script’s source code to see what I was working with. I had a few light styles I could use right away on the type selector:

baseline-status {
  background: #000;
  border: solid 5px #f8a100;
  border-radius: 8px;
  color: #fff;
  display: block;
  margin-block-end: 1.5em;
  padding: .5em;
}

I noticed a CSS color variable in the source code that I could use in place of hard-coded values, so I redefined them and set them where needed:

baseline-status {
  --color-text: #fff;
  --color-outline: var(--orange);

  border: solid 5px var(--color-outline);
  border-radius: 8px;
  color: var(--color-text);
  display: block;
  margin-block-end: var(--gap);
  padding: calc(var(--gap) / 4);
}

Now for a tricky part. The component’s markup looks close to this in the DOM when fully rendered:

<baseline-status class="wp-block-css-tricks-baseline-status" featureid="anchor-positioning"></baseline-status>
<h1>Anchor positioning</h1>
<details>
  <summary aria-label="Baseline: Limited availability. Supported in Chrome: yes. Supported in Edge: yes. Supported in Firefox: no. Supported in Safari: no.">
    <baseline-icon aria-hidden="true" support="limited"></baseline-icon>
    <div class="baseline-status-title" aria-hidden="true">
      <div>Limited availability</div>
        <div class="baseline-status-browsers">
        <!-- Browser icons -->
        </div>
    </div>
  </summary><p>This feature is not Baseline because it does not work in some of the most widely-used browsers.</p><p><a href="https://github.com/web-platform-dx/web-features/blob/main/features/anchor-positioning.yml">Learn more</a></p></details>
<baseline-status class="wp-block-css-tricks-baseline-status" featureid="anchor-positioning"></baseline-status>

I wanted to play with the idea of hiding the <h1> element in some contexts but thought twice about it because not displaying the title only really works for Almanac content when you’re on the page for the same feature as what’s rendered in the component. Any other context and the heading is a “need” for providing context as far as what feature we’re looking at. Maybe that can be a future enhancement where the heading can be toggled on and off.

Voilà

Get the plugin!

This is freely available in the WordPress Plugin Directory as of today! This is my very first plugin I’ve submitted to WordPress on my own behalf, so this is really exciting for me!

Future improvements

This is far from fully baked but definitely gets the job done for now. In the future it’d be nice if this thing could do a few more things:

  • Live update: The widget does not update on the back end until the page refreshes. I’d love to see the final rendering before hitting Publish on something. I got it where typing into the text input is instantly reflected on the back end. It’s just that the component doesn’t re-render to show the update.
  • Variations: As in “large” and “small”.
  • Heading: Toggle to hide or show, depending on where the block is used.


Baseline Status in a WordPress Block originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

by: Zainab Sutarwala
Wed, 05 Feb 2025 11:24:00 +0000


Programmers have to spend a huge amount of their time on the computer and because of these long hours of mouse usage, they develop Repetitive Strain Injuries. And using a standard mouse can aggravate these injuries.

The computer mouse puts your palm in a neutral position is the best way of alleviating such problems – enter trackball or vertical mice. With several options available in the market right now, a programmer can be a little confused to find the best mouse for their needs. Nothing to worry about, as this post will help you out.

Best Mouse for Programming

Also Read: 8 Best Keyboards for Programming in India

Best Mouse for Programming in India

Unsurprisingly, a big mouse with an ergonomic shape fits perfectly in your hand and works great with maximum sought function. Rubber grip close to the thumb and perimeters of the mouse that makes it very less slippery is recommended by some users. Here are some of the best mice for programmers to look at.

1. Logitech MX Master 3

Logitech MX Master 3

Logitech MX Master 3 wireless mouse is one best option for a professional programmer, which is highly versatile for daily use. This mouse has an ergonomic design and is comfortable for long hours of work because of the rounded shape and thumb rest. It is good for your palm grip, though people with smaller hands may have a little trouble gripping this mouse comfortably.

Logitech MX Master 3 mouse is a well-built and heavy mouse, giving it a hefty feel. It is a wireless mouse and its latency will not be noticeable for many, it is not recommended for hardcore gamers. Looking at its positive side, it provides two scroll wheels & gesture commands that make the control scheme diverse. You can set the preferred settings that depend on which program and app you are using.

Pros:

  • Comfy sculpting.
  • Electromagnetic scroll gives precise and freewheeling motion.
  • Works over 3 devices, and between OSs.
  • Amazing battery life.

Cons:

  • Connectivity suffers when connected to several devices through the wireless adapter.

buy now

2. Zebronics Zeb-Transformer-M

Zebronics Zeb-Transformer-M

Zeb-Transformer-M optical mouse is a premium mouse, which comes with six buttons. This has a high precision sensor with a dedicated DPI switch, which will toggle over 1000, 1600, 2400, 3200 DPI. This mouse has seven breathable LED modes, a strong 1.8-meter cable, and it also comes with a quality USB connector.

This mouse is available in black color and has an ergonomic design, which has a solid structure a well as quality buttons. Besides this, this product comes versed with superior quality buttons as well as high precision with gold plated USB. It is one perfect mouse available with a USB interface and sensor optical. The cable length is 1.8 meters.

Pros:

  • This mouse has seven colors that can be selected as per your need.
  • Compact shape & ergonomic design
  • Top-notch quality buttons and best gaming performance.

Cons:

  • Keys aren’t tactile.
  • Packaging isn’t good.

buy now

3. Redgear A-15 Wired Gaming Mouse

Redgear A-15 Wired Gaming Mouse

Redgear A-15 wired mouse provides maximum personalization with the software. This is the mouse very simple to control the dpi, and RGB preference according to your game or gaming setup. Initially, Redgear A15 seems to be the real gaming mouse. This all-black design & RGB lighting are quite appealing and offer a gamer vibe. Its build quality is amazing, with the high-grade exterior plastic casing, which feels fantastic.

The sides of this mouse are covered with textured rubber, and ensuring perfect grip when taking a headshot. There are 2 programmable buttons that are on the left side, and simple to reach with the thumbs. The mouse has the best overall build quality as well as provides amazing comfort.

Pros:

  • 16.8 million customization colour option
  • DPI settings
  • High-grade plastic
  • 2 programmable buttons

Cons:

  • Poor quality connection wire

buy now

4. Logitech G402 Hyperion Fury

Logitech G402 Hyperion Fury

Logitech G402 Hyperion Fury wired mouse is the best-wired mouse made especially for FPS games. It is well-built, with an ergonomic shape, which is well suited for the right-handed palm and claw grip. This has a good number of programmable buttons, which include the dedicated sniper button on its side.

Besides the usual left and right buttons and scroll wheel, this mouse boasts the sniper button (with one-touch DPI), DPI up & down buttons (that cycle between 4 DPI presets), and 2 programmable thumb buttons. This mouse delivers great performance and has low click latency with high polling rate. It offers a responsive and smooth gaming experience. Sadly, it is a bit heavier, and the rubber-coated cable appears a little stiff. Also, its scroll wheel is basic and does not allow for left and right tilt input and infinite scrolling.

Pros:

  • Customizable software
  • Good ergonomics
  • DPI on-a-fly switch
  • Amazing button positioning

Cons:

  • A bit expensive
  • No discrete DPI axis
  • The scroll wheel is not much solid
  • Not perfect for the non-FPS titles

buy now

5. Lenovo Legion M200

Lenovo Legion M200

Lenovo Legion M200 RGB is wired from the Lenovo company. With its comfortable design, the mouse offers amazing functionality and performance at a very good price range. You can get the wired gaming mouse at a good price. Lenovo Legion M200 Mouse is made for amateur and beginners PC gamers. With the comfortable ambidextrous pattern, it is quite affordable but provides uncompromising features and performance.

Legion comes with 5-button design and 2400 DPI that have four levels of the DPI switch, 7 backlight colors, and braided cable. It’s simple to use as well as set up without extra complicated software. It has an adjustable four-level DPI setting; 30” per second movement speed; 500 fps frame rate; seven colors circulating backlight.

Pros:

  • RGB lights are great
  • Ergonomic design
  • Cable quality is amazing
  • Build Quality is perfect
  • Get 1 Year Warranty
  • Grip is perfect

Cons:

  • Customization is not there.
  • A bit bulky

buy now

6. HP 150 Truly Ambidextrous

HP 150 Truly Ambidextrous

Straddling the gaming world and productivity are two important things that HP 150 Truly Ambidextrous Wireless Mouse does great. It is one of the most comfortable, satisfying, and luxurious mice with the smart leatherette sides that elevate the experience. It has an elegant ergonomic design that gives you complete comfort while using it for long hours. It feels quite natural, you will forget that you are holding a mouse.

The mouse has 3 buttons. Right-click, left-click, and center clicks on the dual-function wheel. You have got all control that you want in just one fingertip. With a 1600 DPI sensor, the mouse works great on any surface with great accuracy. Just stash this mouse with your laptop in your bag and you are set to go.

Pros:

  • Looks great
  • Comfortable
  • Great click action

Cons: 

  • Wireless charging
  • The scroll wheel feels a bit light

buy now

7. Lenovo 530

Lenovo 530 Wireless Mouse

Lenovo 530 Wireless Mouse is perfect for controlling your PC easily at any time and any place. This provides cordless convenience with a 2.4 GHz nano-receiver, which means you may seamlessly scroll without any clutter in the area. This has a contoured design and soft-touch finish to get complete comfort.

It is a plug-n-play device, with cordless convenience it has a 2.4 GHz wireless feature through a nano USB receiver. Get all-day comfort & maximum ergonomics with the contoured and unique design and soft and durable finish. Lenovo 530 Mouse is just a perfect mouse-of-choice.

Pros:

  • Best travel mouse for work or for greater control.
  • Available in five different color variants.
  • Long 12month battery life.
  • Can work with another brand laptop.

Cons:

  • The dual-tone finish makes it look a bit cheap.

buy now

8. Dell MS116

Dell MS116

If you are looking for an affordable and good feature mouse for daily work, which is comfortable for use, get a Dell MS116 mouse. It is one perfect mouse that you are searching for. Dell mouse has optical LED tracking & supports a decent 1000 dpi, and making this mouse perform at a reasonable speed & accuracy. It is the wired mouse that has got batteries to work smoothly. Dell MS116 mouse comes in a black matte finish.

The mouse is pretty compatible with any other device – no matter whether it is Mac OS or Windows, or Linux. This mouse is quite affordable. There aren’t many products in this price range, which give you such a good accuracy as well as performance, as Dell MS116 optical mouse does.

Pros:

  • The grip of this mouse is highly comfortable to users when working.
  • Available at an affordable rate.
  • The durability of the product is great long.

Cons:

  • The Bluetooth facility isn’t given.
  • Not made for playing games.
  • The warranty period of the mouse is short.

buy now

Final Words

Preferably, the highly convenient and handy mouse for programmers will be one with the best comfort and designs that fit your hand and hold design perfectly. A flawless device won’t just make you very less worn out yet suggest lesser threats to your overall health in the future.

Among different mouse styles with mild improvements, certainly, you will find quite fascinating ones, like the upright controller or trackball. Despite how unusual they appear, these layouts have verified benefits and seem to be easy to get used to. These are some top-rated mouse for programmers.

The post 8 Best Mouse for Programming in India 2025 appeared first on The Crazy Programmer.

by: Neeraj Mishra
Wed, 05 Feb 2025 10:05:00 +0000


Python has some of the most frequently used frameworks that have been chosen due to the simplicity of development and minimal learning curve. Based on the latest Stack Overflow 2020 poll, 66 percent of programmers are using the two of the most popular Python web frameworks, Django and Flask, and would want to continue using them. In addition, according to the study, Django is the fourth most desired web framework.

If you are looking to hire Python programmers, you should know that Python frameworks are in high demand since Python is an open-source software being used and produced by software developers worldwide. It is easily customizable and adheres to industry standards for interaction, automating programming, and certification.

Python has emerged as an excellent platform. It has been a popular choice among developers, and with the addition of numerous frameworks, it is quickly becoming a market leader.

Python is also gaining popularity due to significant qualities such as functionality, originality, and general curiosity that have emerged as reasonably important factors. However, we are all aware of the fact that frameworks may aid in the development cycle by making it much easier for developers to work on a project.

Top 5 Python Frameworks

Top 5 Python Frameworks in 2021-min

1. Django

It is the most popular comprehensive python framework, ranking in the top ten web frameworks of the year 2020. It is easily accessible software that you can use, with a plethora of characteristics that makes website building much easier.

It comprises URL navigation, dbms configuration management and paradigm upgrades, as well as authentication, virtual server integration, a template engine, and an object-relational mapper (ORM).  It helps in the creation and delivery of highly scalable, quick, and resilient online applications. It has extensive documentation and customer assistance. It also includes pre-built packages as well as libraries that are ready to use.

2. Pyramid

Just another comprehensive Python framework is Pyramid whose main objective is to make creating programs of any complexity straightforward. It offers significant testing assistance as well as versatile development tools. Pyramid’s function decorators make it simple to send Ajax queries. It employs a versatile method to secure authorisation and verification.

With simple URL creation, fragment shaders, propositions and formatting, and material requirements, it makes web application development and implementation much more enjoyable, reliable, and efficient. Quality measurement, infrastructure security, structuring, extensive documentation, and HTML structure creation are also included in the pyramid.

3. Flask

Flask is often regarded as the greatest Python microframework because it is extremely lightweight, flexible, and adaptable. It is open-source and works with Google App Engine. It has enhanced and secured support for cookies for building client-side connections, and makes recommendations rather than imposing any requirements.

Flask has an integrated development server, HTTP request processing, and Jinja2 templating. It has a simple architecture and supports unit testing.  Some of the other significant characteristics of Flask include object-relational mapping, a configurable app structure for file storage, and built-in debugging that is quick, utilises Unicode, and is completely WSGI compliant.

4. Web2Py

Web2Py is another open and free, comprehensive based on Python web interface that is mostly put to use for the rapid creation of massively efficient, secured, and modular database-driven internet applications. With the help of a web browser, a Standard Query Language database, and a web-based frontend, this framework conveniently manages the Python application development method.

Clients can also use web browsers to develop, organise, administer, and release web-based applications. If something goes wrong, it features an in-built mechanism for releasing tickets. Web2Py is highly customizable, which means it is fully compatible and has a large community of supporters.

5. CubicWeb

It is an LGPL-licensed semantic python custom web foundation. This framework aids developers in the construction of web apps by reusing cube-based elements. It adheres to an object-oriented structure, which makes the software more efficient, easier to understand and analyze.

It facilitates data-related inquiries by incorporating RQL, or Relational Query Language, that offers a concise language for relationship questions, manages datasets, and views aspects and connections. Other qualities include using semi-automatic techniques for Html / css generation, security procedures and Semantic Web Framework, Administrative databases, and storing backup reliability.

Conclusion

Python is seeing an unexpected rising trend. And there is no hint of a slowdown soon. Python is likely to exceed Java and C# in the next few years, indicating that there is much more to come. Many of today’s leading technology businesses, like Google, Netflix, and Instagram, use Python frameworks for web development.

Because Python lacks the built-in functionality necessary to expedite bespoke web application development, many programmers prefer Python’s extensive selection of frameworks to cope with implementation nuances. Rather than creating the same software for each project, Python developers may use the framework’s fully prepared modules.

When selecting a framework for any development, take into consideration the features and functions that it offers. The requirements and the capacity of a framework to meet those criteria will decide the success of your project. In this article, we have covered the essential aspects of the top 5 Python frameworks, that will assist you in determining the requirement of any of these frameworks when working on a web development project.

The post Top 5 Python Frameworks in 2025 appeared first on The Crazy Programmer.

by: Chirag Manghnani
Tue, 04 Feb 2025 11:51:00 +0000


Wondering how much is a Software Engineer salary in India?

You’re at the right stop, and we’ll help you get your mind clear on the scope of the Software Engineers demand in India. Besides, you’ll also understand how much average a Software Engineer makes based on different locations and work experience.

Who is a Software Engineer or Developer?

Software Engineer

Image Source

A software engineer plays an essential role in the field of software design and development. The developer is usually the one who helps create the ways that a software design team works.

The software developer may collaborate with the creator to integrate the program’s various roles into a single structure. In addition, the engineer interacts with programmers and codecs to map different programming activities and smaller functions, merged in more significant, running programs and new applications for current applications.

Who can be a Software Engineer?

An individual must typically have a Bachelor’s in information technology, computer science, or a similar field to work as a software engineer. Many organizations choose applicants for this position that can demonstrate practical programming and coding expertise.

Generally, to become a Software Engineer, one needs the following:

  • A bachelor’s degree in Computer Engineering/Computer Science/Information Technology
  • Understanding of programming languages such as JAVA or Python
  • An acquaintance of high school mathematics 

Skills required to become an expert in Software Engineer are:

  • Python 
  • Java
  • C ++
  • Databases such as Oracle and MySQL
  • Basic networking concepts

These skills will help an individual grow their career in the field of Software Engineers or Developers.

However, one should also be familiar with the following given skills to excel and stay updated in the field of Software Engineering:

  • Object-oriented Design or OOD
  • Debugging a program
  • Testing Software 
  • Coding in modern languages such as Ruby, R and Go
  • Android Development
  • HTML, CSS, and JavaScript
  • Artificial Intelligence (AI)

Software Engineer Salary in India

According to the latest statistics from Indeed, a Software Engineer gets an average annual pay of INR 4,38,090 in India. For the past 36 months, salary figures are based on 5,031 payrolls privately submitted to India to staff and customers of software engineers through past and current job ads. A software engineer’s average period is shorter than one year. 

Software Engineer Salary in India

Besides, as per the Payscale Report, the average Software Engineer salary in India is around INR 5,23,770.

Average Software Engineer Salary in India

So, we can conclude on this basis that the average salary of a Software Engineer lies somewhere between INR 4 to 6 lacs. 

Software Engineer Salary in India based on Experience

A software engineer at entry-level with less than one year of experience should expect an average net salary of INR 4 lacs based on a gross compensation of 2,377 wages (including tips, incentives, and overtime work). A candidate with 1-4 years of experience as a software developer receives an annual salary of INR 5-6 lacs based on approximately 15,0000 salaries in India in different locations.

A 5-9-year midcareer software engineer receives an overall amount of INR 88,492 payout based on 3,417 salaries. An advanced software engineer with 10 to 19 years ‘ experience will get an annual gross salary of INR 1,507,360. For the last 20 years of Software Engineers’ service, they can earn a cumulative average of INR 8813,892.

Check out the Payscale graph of Software Engineer based on the work experience in India:

Software Engineer Salary graph

Top Employer Companies Salary Offering to Software Engineers in India

Company Annual Salary
Capgemini INR 331k
Tech Mahindra Ltd INR 382k
HCL Technologies INR 388k
Infosys Ltd INR 412k
Tata Consultancy Services Ltd INR 431k
Accenture INR 447k
Accenture Technology Solutions INR 455k
Cisco Systems Inc. INR 1M

The Top company names offering jobs to Software Engineers in India are Tata Consultancy Services Limited, HCL Technologies Ltd., and Tech Mahindra Ltd. The average salary at Cisco Systems Inc is INR 1.246.679, and the recorded wages are highest. Accenture Technology Solutions and Accenture’s Software Engineers earn about INR 454,933 and 446,511, respectively, and are other companies that provide high salaries for their position. At about INR 330,717, Capgemini pays the lowest. Tech Mahindra Ltd and HCL Technologies Ltd. produce the lower ends of the scale pay around INR 3,82,426 and 3,87,826.

Software Engineer Salary in India based on Popular Skills

Skill Average Salary
Python INR 6,24,306
Java INR 5,69,020
JavaScript INR 5,31,758
C# INR 5,03,781
SQL INR 4,95,382

Python, Java, and JavaScript skills are aligned with a higher overall wage. On the other hand, C# Programming Language and SQL skills cost less than the average rate. 

Software Engineer Salary in India based on Location

Location Average Salary
Bangalore INR 5,74,834
Chennai INR 4,51,541
Hyderabad INR 5,14,290
Pune INR 4,84,030
Mumbai INR 4,66,004
Gurgaon INR 6,53,951

Haryana receives an average of 26.6% higher than the national average workers of Software Engineer in the Gurgaon job category. In Bangalore, Karnataka (16.6% more), and Hyderabad, Andhra Pradesh (3.6 percent more), these work types also indicate higher incomes than average. In Noida, Uttar Pradesh, Mumbai, Maharashtra, and Chennai, Tamil Nadu, the lowest salaries were found (6.6% lower). The lowest salaries are 4.7% lower.

Software Engineer Salary in India based on Roles

Role Average Salary
Senior Software Engineer
INR 486k – 2m
Software Developer INR 211k – 1m
Sr. Software Engineer / Developer / Programmer INR 426k – 2m
Team Leader, IT INR 585k – 2m
Information Technology (IT) Consultant INR 389k – 2m
Software Engineer / Developer / Programmer INR 219k – 1m
Web Developer INR 123k – 776k
Associate Software Engineer INR 238k – 1m
Lead Software Engineer INR 770k – 3m
Java Developer INR 198k – 1m

FAQs related to Software Engineering Jobs and Salaries in India

Q1. How much do Software Engineer employees make?

The average salary for jobs in software engineering ranges from 5 to 63 lacs based on 6619 profiles. 

Q2. What is the highest salary offered as Software Engineer?

Highest reported salary offered to the Software Engineer is ₹145.8lakhs. The top 10% of employees earn more than ₹26.9lakhs per year. The top 1% earn more than a whopping ₹63.0lakhs per year.

Q3. What is the median salary offered as Software Engineer?

The average salary estimated so far from wage profiles is approximately 16.4 lacs per year.

Q.4 What are the most common skills required as a Software Engineer?

The most common skills required for Software Engineering are Python, Java, JavaScript, C#, C, and SQL.

Q5. What are the highest paying jobs as a Software Engineer?

The top 5 highest paying jobs as Software Engineer with reported salaries are:

  • Senior Sde – ₹50.4lakhs per year
  • Sde 3 – ₹37.5lakhs per year
  • Sde Iii – ₹33.2lakhs per year
  • Chief Software Engineer – ₹32.6lakhs per year
  • Staff Software Test Engineer – ₹30.6lakhs per year

Conclusion

In India, the pay of Software Engineers is one of the country’s most giant packs. How much you value will depend on your abilities, your background, and the community you live in.

The Software Engineer salary in India depends on so many factors that we’ve listed in this post. Based on your expertise level and your work experience, you can extract as high CTC per annum in India as in other countries.

Cheers to Software Engineers!

The post Software Engineer Salary in India 2025 appeared first on The Crazy Programmer.

by: Chris Coyier
Mon, 03 Feb 2025 17:27:05 +0000


I kinda like the idea of the “minimal” service worker. Service Workers can be pretty damn complicated and the power of them honestly makes me a little nervous. They are middlemen between the browser and the network and I can imagine really dinking that up, myself. Not to dissuade you from using them, as they can useful things no other technology can do.

That’s why I like the “minimal” part. I want to understand what it’s doing extremely clearly! The less code the better.

Tantek posted about that recently, with a minimal idea:

You have a service worker (and “offline” HTML page) on your personal site, installed from any page on your site, that all it does is cache the offline page, and on future requests to your site checks to see if the requested page is available, and if so serves it, otherwise it displays your offline page with a “site appears to be unreachable” message that a lot of service workers provide, AND provides an algorithmically constructed link to the page on an archive (e.g. Internet Archive) or static mirror of your site (typically at another domain).

That seems clearly useful. The bit about linking to an archive of the page though seems a smidge off to me. If the reason a user can’t see the page is because they are offline, a page that sends them to the Internet Archive isn’t going to work either. But I like the bit about caching and at least trying to do something.

Jeremy Keith did some thinking about this back in 2018 as well:

The logic works like this:

  • If there’s a request for an HTML page, fetch it from the network and store a copy in a cache (but if the network request fails, try looking in the cache instead).
  • For any other files, look for a copy in the cache first but meanwhile fetch a fresh version from the network to update the cache (and if there’s no existing version in the cache, fetch the file from the network and store a copy of it in the cache).

The implementation is actually just a few lines of code. A variation of it handles Tantek’s idea as well, implementing a custom offline page that could do the thing where it links off to an archive elsewhere.

I’ll leave you with a couple more links. Have you heard the term LoFi? I’m not the biggest fan of the shortening of it because “Lo-fi” is a pretty established musical term not to mention “low fidelity” is useful in all sorts of contexts. But recently in web tech it refers to “Local First”.

I see “local-first” as shifting reads and writes to an embedded database in each client via “sync engines” that facilitate data exchange between clients and servers. Applications like Figma and Linear pioneered this approach, but it’s becoming increasingly easy to do.

Some notes on Local-First Development, Kyle Matthews

I dig the idea honestly and do see it as a place for technology (and companies that make technology) to step and really make this style of working easy. Plenty of stuff already works this way. I think of the Notes app on my phone. Those notes are always available. It doesn’t (seem to) care if I’m online or offline. If I’m online, they’ll sync up with the cloud so other devices and backups will have the latest, but if not, so be it. It better as heck work that way! And I’m glad it does, but lots of stuff on the web does not (CodePen doesn’t). But I’d like to build stuff that works that way and have it not be some huge mountain to climb.

That eh, we’ll just sync later/whenever when we have network access is super non-trivial, is part of the issue. Technology could make easy/dumb choices like “last write wins”, but that tends to be dangerous data-loss territory that users don’t put up with. Instead data need to be intelligently merged, and that isn’t easy. Dropbox is multi-billion dollar company that deals with this and they admittedly don’t always have it perfect. One of the major solutions is the concept of CRDTs, which are an impressive idea to say the least, but are complex enough that most of us will gently back away. So I’ll simply leave you with A Gentle Introduction to CRDTs.

by: Ryan Trimble
Mon, 03 Feb 2025 15:23:37 +0000


Suppose you follow CSS feature development as closely as we do here at CSS-Tricks. In that case, you may be like me and eager to use many of these amazing tools but find browser support sometimes lagging behind what might be considered “modern” CSS (whatever that means).

Even if browser vendors all have a certain feature released, users might not have the latest versions!

We can certainly plan for this a number of ways:

  • feature detection with @supports
  • progressively enhanced designs
  • polyfills

For even extra help, we turn to build tools. Chances are, you’re already using some sort of build tool in your projects today. CSS developers are most likely familiar with CSS pre-processors (such as Sass or Less), but if you don’t know, these are tools capable of compiling many CSS files into one stylesheet. CSS pre-processors help make organizing CSS a lot easier, as you can move parts of CSS into related folders and import things as needed.

Pre-processors do not just provide organizational superpowers, though. Sass gave us a crazy list of features to work with, including:

  • extends
  • functions
  • loops
  • mixins
  • nesting
  • variables
  • …more, probably!

For a while, this big feature set provided a means of filling gaps missing from CSS, making Sass (or whatever preprocessor you fancy) feel like a necessity when starting a new project. CSS has evolved a lot since the release of Sass — we have so many of those features in CSS today — so it doesn’t quite feel that way anymore, especially now that we have native CSS nesting and custom properties.

Along with CSS pre-processors, there’s also the concept of post-processing. This type of tool usually helps transform compiled CSS in different ways, like auto-prefixing properties for different browser vendors, code minification, and more. PostCSS is the big one here, giving you tons of ways to manipulate and optimize your code, another step in the build pipeline.

In many implementations I’ve seen, the build pipeline typically runs roughly like this:

  1. Generate static assets
  2. Build application files
  3. Bundle for deployment

CSS is usually handled in that first part, which includes running CSS pre- and post-processors (though post-processing might also happen after Step 2). As mentioned, the continued evolution of CSS makes it less necessary for a tool such as Sass, so we might have an opportunity to save some time.

Vite for CSS

Awarded “Most Adopted Technology” and “Most Loved Library” from the State of JavaScript 2024 survey, Vite certainly seems to be one of the more popular build tools available. Vite is mainly used to build reactive JavaScript front-end frameworks, such as Angular, React, Svelte, and Vue (made by the same developer, of course). As the name implies, Vite is crazy fast and can be as simple or complex as you need it, and has become one of my favorite tools to work with.

Vite is mostly thought of as a JavaScript tool for JavaScript projects, but you can use it without writing any JavaScript at all. Vite works with Sass, though you still need to install Sass as a dependency to include it in the build pipeline. On the other hand, Vite also automatically supports compiling CSS with no extra steps. We can organize our CSS code how we see fit, with no or very minimal configuration necessary. Let’s check that out.

We will be using Node and npm to install Node packages, like Vite, as well as commands to run and build the project. If you do not have node or npm installed, please check out the download page on their website.

Navigate a terminal to a safe place to create a new project, then run:

npm create vite@latest

The command line interface will ask a few questions, you can keep it as simple as possible by choosing Vanilla and JavaScript which will provide you with a starter template including some no-frameworks-attached HTML, CSS, and JavaScript files to help get you started.

terminal displaying the output of running the command npm create vite@latest

Before running other commands, open the folder in your IDE (integrated development environment, such as VSCode) of choice so that we can inspect the project files and folders.

If you would like to follow along with me, delete the following files that are unnecessary for demonstration:

  • assets/
  • public/
  • src/
  • .gitignore

We should only have the following files left in out project folder:

  • index.html
  • package.json
VSCode file browser display two files: index.html and package.json

Let’s also replace the contents of index.html with an empty HTML template:

<!doctype html>

<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
	
    <title>CSS Only Vite Project</title>
  </head>
  <body>
    <!-- empty for now -->
  </body>
</html>

One last piece to set up is Vite’s dependencies, so let’s run the npm installation command:

npm install
terminal displaying the output of running the command npm install

A short sequence will occur in the terminal. Then we’ll see a new folder called node_modules/ and a package-lock.json file added in our file viewer.

  • node_modules is used to house all package files installed through node package manager, and allows us to import and use installed packages throughout our applications.
  • package-lock.json is a file usually used to make sure a development team is all using the same versions of packages and dependencies.
VSCode file browser displaying a node_modules folder, index.html file, package-lock.json file, and a package.json file

We most likely won’t need to touch these things, but they are necessary for Node and Vite to process our code during the build. Inside the project’s root folder, we can create a styles/ folder to contain the CSS we will write. Let’s create one file to begin with, main.css, which we can use to test out Vite.

├── public/
├── styles/
|   └── main.css
└──index.html

In our index.html file, inside the <head> section, we can include a <link> tag pointing to the CSS file:

<head>
  <meta charset="UTF-8" />
  <link rel="icon" type="image/svg+xml" href="/vite.svg" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
	
  <title>CSS Only Vite Project</title>

  <!-- Main CSS -->
  <link rel="stylesheet" href="styles/main.css">
</head>

Let’s add a bit of CSS to main.css:

body {
  background: green;
}

It’s not much, but it’s all we’ll need at the moment! In our terminal, we can now run the Vite build command using npm:

npm run build

With everything linked up properly, Vite will build things based on what is available within the index.html file, including our linked CSS files. The build will be very fast, and you’ll be returned to your terminal prompt.

Terminal displaying the output of the command npm run build, including the filesizes of compiled files
Vite will provide a brief report, showcasing the file sizes of the compiled project.

The newly generated dist/ folder is Vite’s default output directory, which we can open and see our processed files. Checking out assets/index.css (the filename will include a unique hash for cache busting), and you’ll see the code we wrote, minified here.

VSCode editor displaying a minified CSS file

Now that we know how to make Vite aware of our CSS, we will probably want to start writing more CSS for it to compile.

As quick as Vite is with our code, constantly re-running the build command would still get very tedious. Luckily, Vite provides its own development server, which includes a live environment with hot module reloading, making changes appear instantly in the browser. We can start the Vite development server by running the following terminal command:

npm run dev
Vite development server running in a terminal

Vite uses the default network port 5173 for the development server. Opening the http://localhost:5137/ address in your browser will display a blank screen with a green background.

Arc browser window, navigated to http://localhost:5173, a blank page with a green background

Adding any HTML to the index.html or CSS to main.css, Vite will reload the page to display changes. To stop the development server, use the keyboard shortcut CTRL+C or close the terminal to kill the process.

At this point, you pretty much know all you need to know about how to compile CSS files with Vite. Any CSS file you link up will be included in the built file.

Organizing CSS into Cascade Layers

One of the items on my 2025 CSS Wishlist is the ability to apply a cascade layer to a link tag. To me, this might be helpful to organize CSS in a meaningful ways, as well as fine control over the cascade, with the benefits cascade layers provide. Unfortunately, this is a rather difficult ask when considering the way browsers paint styles in the viewport. This type of functionality is being discussed between the CSS Working Group and TAG, but it’s unclear if it’ll move forward.

With Vite as our build tool, we can replicate the concept as a way to organize our built CSS. Inside the main.css file, let’s add the @layer at-rule to set the cascade order of our layers. I’ll use a couple of layers here for this demo, but feel free to customize this setup to your needs.

/* styles/main.css */
@layer reset, layouts;

This is all we’ll need inside our main.css, let’s create another file for our reset. I’m a fan of my friend Mayank‘s modern CSS reset, which is available as a Node package. We can install the reset by running the following terminal command:

npm install @acab/reset.css
Terminal displaying the output of running npm install @acab/reset.css

Now, we can import Mayank’s reset into our newly created reset.css file, as a cascade layer:

/* styles/reset.css */
@import '@acab/reset.css' layer(reset);

If there are any other reset layer stylings we want to include, we can open up another @layer reset block inside this file as well.

/* styles/reset.css */
@import '@acab/reset.css' layer(reset);

@layer reset {
  /* custom reset styles */
}

This @import statement is used to pull packages from the node_modules folder. This folder is not generally available in the built, public version of a website or application, so referencing this might cause problems if not handled properly.

Now that we have two files (main.css and reset.css), let’s link them up in our index.html file. Inside the <head> tag, let’s add them after <title>:

<head>
  <meta charset="UTF-8" />
  <link rel="icon" type="image/svg+xml" href="/vite.svg" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
	
  <title>CSS Only Vite Project</title>
	
  <link rel="stylesheet" href="styles/main.css">
  <link rel="stylesheet" href="styles/reset.css">
</head>

The idea here is we can add each CSS file, in the order we need them parsed. In this case, I’m planning to pull in each file named after the cascade layers setup in the main.css file. This may not work for every setup, but it is a helpful way to keep in mind the precedence of how cascade layers affect computed styles when rendered in a browser, as well as grouping similarly relevant files.

Since we’re in the index.html file, we’ll add a third CSS <link> for styles/layouts.css.

<head>
  <meta charset="UTF-8" />
  <link rel="icon" type="image/svg+xml" href="/vite.svg" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
	
  <title>CSS Only Vite Project</title>
	
  <link rel="stylesheet" href="styles/main.css">
  <link rel="stylesheet" href="styles/reset.css">
  <link rel="stylesheet" href="styles/layouts.css">
</head>

Create the styles/layouts.css file with the new @layer layouts declaration block, where we can add layout-specific stylings.

/* styles/layouts.css */
@layer layouts {
  /* layouts styles */
}

For some quick, easy, and awesome CSS snippets, I tend to refer to Stephanie EcklesSmolCSS project. Let’s grab the “Smol intrinsic container” code and include it within the layouts cascade layer:

/* styles/layouts.css */
@layer layouts {
  .smol-container {
    width: min(100% - 3rem, var(--container-max, 60ch));
    margin-inline: auto;
  }
}

This powerful little, two-line container uses the CSS min() function to provide a responsive width, with margin-inline: auto; set to horizontally center itself and contain its child elements. We can also dynamically adjust the width using the --container-max custom property.

Now if we re-run the build command npm run build and check the dist/ folder, our compiled CSS file should contain:

  • Our cascade layer declarations from main.css
  • Mayank’s CSS reset fully imported from reset.css
  • The .smol-container class added from layouts.csss

As you can see, we can get quite far with Vite as our build tool without writing any JavaScript. However, if we choose to, we can extend our build’s capabilities even further by writing just a little bit of JavaScript.

Post-processing with LightningCSS

Lightning CSS is a CSS parser and post-processing tool that has a lot of nice features baked into it to help with cross-compatibility among browsers and browser versions. Lightning CSS can transform a lot of modern CSS into backward-compatible styles for you.

We can install Lightning CSS in our project with npm:

npm install --save-dev lightningcss

The --save-dev flag means the package will be installed as a development dependency, as it won’t be included with our built project. We can include it within our Vite build process, but first, we will need to write a tiny bit of JavaScript, a configuration file for Vite. Create a new file called: vite.config.mjs and inside add the following code:

// vite.config.mjs
export default {
  css: {
    transformer: 'lightningcss'
  },
  build: {
    cssMinify: 'lightningcss'
  }
};

Vite will now use LightningCSS to transform and minify CSS files. Now, let’s give it a test run using an oklch color. Inside main.css let’s add the following code:

/* main.css */
body {
  background-color: oklch(51.98% 0.1768 142.5);
}

Then re-running the Vite build command, we can see the background-color property added in the compiled CSS:

/* dist/index.css */
body {
  background-color: green;
  background-color: color(display-p3 0.216141 0.494224 0.131781);
  background-color: lab(46.2829% -47.5413 48.5542);
}

Lightning CSS converts the color white providing fallbacks available for browsers which might not support newer color types. Following the Lightning CSS documentation for using it with Vite, we can also specify browser versions to target by installing the browserslist package.

Browserslist will give us a way to specify browsers by matching certain conditions (try it out online!)

npm install -D browserslist

Inside our vite.config.mjs file, we can configure Lightning CSS further. Let’s import the browserslist package into the Vite configuration, as well as a module from the Lightning CSS package to help us use browserlist in our config:

// vite.config.mjs
import browserslist from 'browserslist';
import { browserslistToTargets } from 'lightningcss';

We can add configuration settings for lightningcss, containing the browser targets based on specified browser versions to Vite’s css configuration:

// vite.config.mjs
import browserslist from 'browserslist';
import { browserslistToTargets } from 'lightningcss';

export default {
  css: {
    transformer: 'lightningcss',
    lightningcss: {
      targets: browserslistToTargets(browserslist('>= 0.25%')),
    }
  },
  build: {
    cssMinify: 'lightningcss'
  }
};

There are lots of ways to extend Lightning CSS with Vite, such as enabling specific features, excluding features we won’t need, or writing our own custom transforms.

// vite.config.mjs
import browserslist from 'browserslist';
import { browserslistToTargets, Features } from 'lightningcss';

export default {
  css: {
    transformer: 'lightningcss',
    lightningcss: {
      targets: browserslistToTargets(browserslist('>= 0.25%')),
      // Including `light-dark()` and `colors()` functions
      include: Features.LightDark | Features.Colors,
    }
  },
  build: {
    cssMinify: 'lightningcss'
  }
};

For a full list of the Lightning CSS features, check out their documentation on feature flags.

Is any of this necessary?

Reading through all this, you may be asking yourself if all of this is really necessary. The answer: absolutely not! But I think you can see the benefits of having access to partialized files that we can compile into unified stylesheets.

I doubt I’d go to these lengths for smaller projects, however, if building something with more complexity, such as a design system, I might reach for these tools for organizing code, cross-browser compatibility, and thoroughly optimizing compiled CSS.


Compiling CSS With Vite and Lightning CSS originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

by: Zainab Sutarwala
Mon, 03 Feb 2025 14:38:00 +0000


There was a time when the companies evaluated the performance of a software engineers based on how quickly they delivered the tasks.

But, 2025 is a different scenario in software development teams.

Nowadays, this isn’t the only criteria. Today called developers, professional software engineers are aware of the importance of soft skills.

Things such as open-mindedness, creativity, and willingness to learn something new are considered soft skills that anyone can use no matter which industry you are in.

Why Are the Soft Skills Very Important?

For a software engineer, soft skills are essential as it makes you a better professional.

Even though you have the hard skills required for the job, you will not get hired if you lack the soft skills to help you connect with the interviewer and other people around you.

With soft skills, developers and programmers are well-equipped to utilize their complex skills to the fullest extent.

The soft skills of engineers and programmers affect how nicely you work with fellow people on your tech team and other teams that will positively impact your career development.

Tools like JavaScript Frameworks and APIs automate the most technical processes. An example is Filestack, which allows the creation of high-performance software that handles the management of millions of files.

Manually adding video, image, or file management functions to an application reliably can be an impossible task without enough tools. The developer needs, in this case, to have more than technical skills to convince the business to invest in the tools.

Top Soft Skills for Software Developers

Soft Skills for Software Developers

1. Creativity

Creativity isn’t only about artistic expression. The technical professions demand a good amount of creativity.

It allows goods software engineers and programmers to solve any complex problems and find new opportunities while developing their innovative products or apps and improving the current ones.

You need to think creatively and practice approaching various problems correctly.

2. Patience

Software development isn’t a simple feat. It is one complex effort that includes long processes.

Most activities take plenty of time in agile environments, whether it is a project kick-off, project execution, deployment, testing, updates, and more.

Patience is vital when you’re starting as a developer or programmer. An important person you will ever need to be patient with is with you.

It would be best to give yourself sufficient time to make mistakes and fix them.

If you’re patient, it becomes simple to stay patient with people around you. At times people will require more convincing.

You have to do your best to “sell” your idea and approach them.

3. Communication

Communication is a basis of collaboration, thus crucial to the software development project.

Whether you’re communicating with colleagues, clients, and managers, do not leave anybody guessing –ensure every developer in the team is on the same page about any aspect of a project.

Besides traditional skills of respect, assertiveness, active listening, empathy, and conflict resolution, the Software Engineers have to develop their mastery of explaining technical information very clearly to the non-techies.

The professional needs to understand what somebody wants to ask if they do not understand the software’s specific parameters.

4. Listenability

These soft talents are intertwined: being a good communicator and a good listener is essential.

Keep in mind that everybody you deal with or communicate with deserves to be heard, and they might have information that can help you do your work efficiently.

Put other distractions apart and focus totally on a person talking to you.

You must keep an eye out for the nonverbal communication indicators since they will disclose a lot about what somebody says.

As per the experts in the field, 93% of the communication is nonverbal.

Thus you must pay close attention to what the colleagues or clients say, even though they are not saying anything.

5. Teamwork

It doesn’t matter what you plan to do. There will be a time when you need to work as a part of the team.

Whether it is the team of designers, developers, programmers, or project teams, developers have to work nicely with others to succeed.

Working with the whole team makes working more fun and makes people help you out in the future.

You might not sometimes agree with other people in the team. However, having a difference of opinion helps to build successful companies.

6. People and Time Management

Software development is about working on one project in the stipulated time frame.

Usually, software developers engineers are highly involved in managing people and different projects. Thus, management is an essential soft skill for software developers.

People and time management are two critical characteristics that the recruiter searches for in the software developer candidate.

A software developer from various experience levels has to work well in the team and meet the time estimates.

Thus, if you want to become a successful software programmer in a good company, it is essential to teach in the successful management of people and time.

7. Problem-solving

There will be a point in your career when you face the problem.

Problems can happen regularly or rarely; however, it’s inevitable. The way you handle your situations will leave a massive impact on your career and the company that you are working for.

Thus, problem-solving is an essential soft skill that employers search for in their prospective candidates; therefore, more examples of problem-solving you have better will be your prospects.

When approaching the new problem, view it objectively, though you did accidentally.

8. Adaptability

Adaptability is another essential soft skill required in today’s fast-evolving world.

This skill means being capable of changing with the changing environment and adjusting the course based on how this situation comes up.

Employers value adaptability and can give you significant benefits in your career.

9. Self-awareness

Software developers must be highly confident in things they know and humble in something they don’t.

So, knowing what area you require improvement is one type of true confidence.

If software development is aware of their weaker sides, they will seek the proper training or mentorship from their colleagues and manager.

In the majority of the cases, when most people deny that they do not know something, it is often a sign of insecurity.

However, if the software developer finds himself secure and acknowledges their weaknesses, it is a sign of maturity that is one valuable skill to possess.

In the same way, to be confident in things that they know is also very important.

Self-confidence allows people to speak out their minds, make lesser mistakes, and face criticism.

10. Open-mindedness

If you are open-minded, you are keen to accept innovative ideas, whether they are yours or somebody else’s.

Even any worst ideas will inspire something incredible if you consider them before you plan to dismiss them. More pictures you get, the more projects you will have the potential to work upon.

Though not each idea you have may turn into something, you do not know what it will be until you have thought in-depth about it.

It would help if you kept an open mind to new ideas from the team and your company and clients.

Your clients are the people who will use your product; thus, they are the best ones to tell you about what works or what they require.

Final Thoughts

All the skills outlined here complement one another. A good skill will lead to higher collaboration & team cohesiveness.

Knowing one’s strengths or weaknesses will improve your accountability skills. So, the result is a well-rounded software developer with solid potential.

These soft skills mentioned in the article are the best input for a brilliant career since it gives several benefits.

Suppose you wonder if you don’t have the given soft skills or find it very late to have it now.

The best thing is that all these soft skills mentioned can quickly be learned or improved.

In 2025, there will be a lot of resources available to help the developer with that. However, it is not very difficult to improve your soft skills. Better to start now.

The post Top 10 Soft Skills for Software Developers in 2025 appeared first on The Crazy Programmer.

Blogger

Chrome 133 Goodies

by: Geoff Graham
Fri, 31 Jan 2025 15:27:50 +0000


I often wonder what it’s like working for the Chrome team. You must get issued some sort of government-level security clearance for the latest browser builds that grants you permission to bash on them ahead of everyone else and come up with these rad demos showing off the latest features. No, I’m, not jealous, why are you asking?

Totally unrelated, did you see the release notes for Chrome 133? It’s currently in beta, but the Chrome team has been publishing a slew of new articles with pretty incredible demos that are tough to ignore. I figured I’d round those up in one place.

attr() for the masses!

We’ve been able to use HTML attributes in CSS for some time now, but it’s been relegated to the content property and only parsed strings.

<h1 data-color="orange">Some text</h1>
h1::before {
  content: ' (Color: ' attr(data-color) ') ';
}

Bramus demonstrates how we can now use it on any CSS property, including custom properties, in Chrome 133. So, for example, we can take the attribute’s value and put it to use on the element’s color property:

h1 {
  color: attr(data-color type(<color>), #fff)
}

This is a trite example, of course. But it helps illustrate that there are three moving pieces here:

  1. the attribute (data-color)
  2. the type (type(<color>))
  3. the fallback value (#fff)

We make up the attribute. It’s nice to have a wildcard we can insert into the markup and hook into for styling. The type() is a new deal that helps CSS know what sort of value it’s working with. If we had been working with a numeric value instead, we could ditch that in favor of something less verbose. For example, let’s say we’re using an attribute for the element’s font size:

<div data-size="20">Some text</div>

Now we can hook into the data-size attribute and use the assigned value to set the element’s font-size property, based in px units:

h1 {
  color: attr(data-size px, 16);
}

The fallback value is optional and might not be necessary depending on your use case.

Scroll states in container queries!

This is a mind-blowing one. If you’ve ever wanted a way to style a sticky element when it’s in a “stuck” state, then you already know how cool it is to have something like this. Adam Argyle takes the classic pattern of an alphabetical list and applies styles to the letter heading when it sticks to the top of the viewport. The same is true of elements with scroll snapping and elements that are scrolling containers.

In other words, we can style elements when they are “stuck”, when they are “snapped”, and when they are “scrollable”.

Quick little example that you’ll want to open in a Chromium browser:

The general idea (and that’s all I know for now) is that we register a container… you know, a container that we can query. We give that container a container-type that is set to the type of scrolling we’re working with. In this case, we’re working with sticky positioning where the element “sticks” to the top of the page.

.sticky-nav {
  container-type: scroll-state;
}

A container can’t query itself, so that basically has to be a wrapper around the element we want to stick. Menus are a little funny because we have the <nav> element and usually stuff it with an unordered list of links. So, our <nav> can be the container we query since we’re effectively sticking an unordered list to the top of the page.

<nav class="sticky-nav">
  <ul>
    <li><a href="#">Home</a></li>
    <li><a href="#">About</a></li>
    <li><a href="#">Blog</a></li>
  </ul>
</nav>

We can put the sticky logic directly on the <nav> since it’s technically holding what gets stuck:

.sticky-nav {
  container-type: scroll-state; /* set a scroll container query */
  position: sticky; /* set sticky positioning */
  top: 0; /* stick to the top of the page */
}

I supposed we could use the container shorthand if we were working with multiple containers and needed to distinguish one from another with a container-name. Either way, now that we’ve defined a container, we can query it using @container! In this case, we declare the type of container we’re querying:

@container scroll-state() { }

And we tell it the state we’re looking for:

@container scroll-state(stuck: top) {

If we were working with a sticky footer instead of a menu, then we could say stuck: bottom instead. But the kicker is that once the <nav> element sticks to the top, we get to apply styles to it in the @container block, like so:

.sticky-nav {
  border-radius: 12px;
  container-type: scroll-state;
  position: sticky;
  top: 0;

  /* When the nav is in a "stuck" state */
  @container scroll-state(stuck: top) {
    border-radius: 0;
    box-shadow: 0 3px 10px hsl(0 0 0 / .25);
    width: 100%;
  }
}

It seems to work when nesting other selectors in there. So, for example, we can change the links in the menu when the navigation is in its stuck state:

.sticky-nav {
  /* Same as before */

  a {
    color: #000;
    font-size: 1rem;
  }

  /* When the nav is in a "stuck" state */
  @container scroll-state(stuck: top) {
    /* Same as before */

    a {
      color: orangered;
      font-size: 1.5rem;
    }
  }
}

So, yeah. As I was saying, it must be pretty cool to be on the Chrome developer team and get ahead of stuff like this, as it’s released. Big ol’ thanks to Bramus and Adam for consistently cluing us in on what’s new and doing the great work it takes to come up with such amazing demos to show things off.


Chrome 133 Goodies originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

by: Geoff Graham
Fri, 31 Jan 2025 14:11:00 +0000


When using View Transitions you’ll notice the page becomes unresponsive to clicks while a View Transition is running. […] This happens because of the ::view-transition pseudo element – the one that contains all animated snapshots – gets overlayed on top of the document and captures all the clicks.

::view-transition /* 👈 Captures all the clicks! */
└─ ::view-transition-group(root)
   └─ ::view-transition-image-pair(root)
      ├─ ::view-transition-old(root)
      └─ ::view-transition-new(root)

The trick? It’s that sneaky little pointer-events property! Slapping it directly on the :view-transition allows us to click “under” the pseudo-element, meaning the full page is interactive even while the view transition is running.

::view-transition {
  pointer-events: none;
}

I always, always, always forget about pointer-events, so thanks to Bramus for posting this little snippet. I also appreciate the additional note about removing the :root element from participating in the view transition:

:root {
  view-transition-name: none;
}

He quotes the spec noting the reason why snapshots do not respond to hit-testing:

Elements participating in a transition need to skip painting in their DOM location because their image is painted in the corresponding ::view-transition-new() pseudo-element instead. Similarly, hit-testing is skipped because the element’s DOM location does not correspond to where its contents are rendered.


Keeping the page interactive while a View Transition is running originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

Blogger

The Mistakes of CSS

by: Juan Diego Rodríguez
Thu, 30 Jan 2025 14:31:08 +0000


Surely you have seen a CSS property and thought “Why?” For example:

Why doesn’t z-index work on all elements, and why is it “-index” anyways?

Or:

Why do we need interpolate-size to animate to auto?

You are not alone. CSS was born in 1996 (it can legally order a beer, you know!) and was initially considered a way to style documents; I don’t think anyone imagined everything CSS would be expected to do nearly 30 years later. If we had a time machine, many things would be done differently to match conventions or to make more sense. Heck, even the CSS Working Group admits to wanting a time-traveling contraption… in the specifications!

NOTE: If we had a time machine, this property wouldn’t need to exist.

CSS Values and Units Module Level 5, Section 10.4

If by some stroke of opportunity, I was given free rein to rename some things in CSS, a couple of ideas come to mind, but if you want more, you can find an ongoing list of mistakes made in CSS… by the CSS Working Group! Take, for example, background-repeat:

Not quite a mistake, because it was a reasonable default for the 90s, but it would be more helpful since then if background-repeat defaulted to no-repeat.

Right now, people are questioning if CSS Flexbox and CSS Grid should share more syntax in light of the upcoming CSS Masonry layout specifications.

Why not fix them? Sadly, it isn’t as easy as fixing something. People already built their websites with these quirks in mind, and changing them would break those sites. Consider it technical debt.

This is why I think the CSS Working Group deserves an onslaught of praise. Designing new features that are immutable once shipped has to be a nerve-wracking experience that involves inexact science. It’s not that we haven’t seen the specifications change or evolve in the past — they most certainly have — but the value of getting things right the first time is a beast of burden.


The Mistakes of CSS originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

by: Juan Diego Rodríguez
Wed, 29 Jan 2025 14:13:53 +0000


Have you ever stumbled upon something new and went to research it just to find that there is little-to-no information about it? It’s a mixed feeling: confusing and discouraging because there is no apparent direction, but also exciting because it’s probably new to lots of people, not just you. Something like that happened to me while writing an Almanac’s entry for the @view-transition at-rule and its types descriptor.

You may already know about Cross-Document View Transitions: With a few lines of CSS, they allow for transitions between two pages, something that in the past required a single-app framework with a side of animation library. In other words, lots of JavaScript.

To start a transition between two pages, we have to set the @view-transition at-rule’s navigation descriptor to auto on both pages, and that gives us a smooth cross-fade transition between the two pages. So, as the old page fades out, the new page fades in.

@view-transition {
  navigation: auto;
}

That’s it! And navigation is the only descriptor we need. In fact, it’s the only descriptor available for the @view-transition at-rule, right? Well, turns out there is another descriptor, a lesser-known brother, and one that probably envies how much attention navigation gets: the types descriptor.

What do people say about types?

Cross-Documents View Transitions are still fresh from the oven, so it’s normal that people haven’t fully dissected every aspect of them, especially since they introduce a lot of new stuff: a new at-rule, a couple of new properties and tons of pseudo-elements and pseudo-classes. However, it still surprises me the little mention of types. Some documentation fails to even name it among the valid  @view-transition descriptors. Luckily, though, the CSS specification does offer a little clarification about it:

The types descriptor sets the active types for the transition when capturing or performing the transition.

To be more precise, types can take a space-separated list with the names of the active types (as <custom-ident>), or none if there aren’t valid active types for that page.

  • Name: types
  • For: @view-transition
  • Value: none | <custom-ident>+
  • Initial: none

So the following values would work inside types:

@view-transition {
  navigation: auto;
  types: bounce;
}

/* or a list */

@view-transition {
  navigation: auto;
  types: bounce fade rotate;
}

Yes, but what exactly are “active” types? That word “active” seems to be doing a lot of heavy lifting in the CSS specification’s definition and I want to unpack that to better understand what it means.

Active types in view transitions

The problem: A cross-fade animation for every page is good, but a common thing we need to do is change the transition depending on the pages we are navigating between. For example, on paginated content, we could slide the content to the right when navigating forward and to the left when navigating backward. In a social media app, clicking a user’s profile picture could persist the picture throughout the transition. All this would mean defining several transitions in our CSS, but doing so would make them conflict with each other in one big slop. What we need is a way to define several transitions, but only pick one depending on how the user navigates the page.

The solution: Active types define which transition gets used and which elements should be included in it. In CSS, they are used through :active-view-transition-type(), a pseudo-class that matches an element if it has a specific active type. Going back to our last example, we defined the document’s active type as bounce. We could enclose that bounce animation behind an :active-view-transition-type(bounce), such that it only triggers on that page.

/* This one will be used! */
html:active-view-transition-type(bounce) {
  &::view-transition-old(page) {
    /* Custom Animation */
  }

  &::view-transition-new(page) {
    /* Custom Animation */
  }
}

This prevents other view transitions from running if they don’t match any active type:

/* This one won't be used! */
html:active-view-transition-type(slide) {
  &::view-transition-old(page) {
    /* Custom Animation */
  }

  &::view-transition-new(page) {
    /* Custom Animation */
  }
}

I asked myself whether this triggers the transition when going to the page, when out of the page, or in both instances. Turns out it only limits the transition when going to the page, so the last bounce animation is only triggered when navigating toward a page with a bounce value on its types descriptor, but not when leaving that page. This allows for custom transitions depending on which page we are going to.

The following demo has two pages that share a stylesheet with the bounce and slide view transitions, both respectively enclosed behind an :active-view-transition-type(bounce) and :active-view-transition-type(slide) like the last example. We can control which page uses which view transition through the types descriptor.

The first page uses the bounce animation:

@view-transition {
  navigation: auto;
  types: bounce;
}

The second page uses the slide animation:

@view-transition {
  navigation: auto;
  types: slide;
}

You can visit the demo here and see the full code over at GitHub.

The types descriptor is used more in JavaScript

The main problem is that we can only control the transition depending on the page we’re navigating to, which puts a major cap on how much we can customize our transitions. For instance, the pagination and social media examples we looked at aren’t possible just using CSS, since we need to know where the user is coming from. Luckily, using the types descriptor is just one of three ways that active types can be populated. Per spec, they can be:

  1. Passed as part of the arguments to startViewTransition(callbackOptions)
  2. Mutated at any time, using the transition’s types
  3. Declared for a cross-document view transition, using the types descriptor.

The first option is when starting a view transition from JavaScript, but we want to trigger them when the user navigates to the page by themselves (like when clicking a link). The third option is using the types descriptor which we already covered. The second option is the right one for this case! Why? It lets us set the active transition type on demand, and we can perform that change just before the transition happens using the pagereveal event. That means we can get the user’s start and end page from JavaScript and then set the correct active type for that case.

I must admit, I am not the most experienced guy to talk about this option, so once I demo the heck out of different transitions with active types I’ll come back with my findings! In the meantime, I encourage you to read about active types here if you are like me and want more on view transitions:


What on Earth is the `types` Descriptor in View Transitions? originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

Blogger

Sigma Browser

by: aiparabellum.com
Tue, 28 Jan 2025 07:28:06 +0000


In the digital age, where online privacy and security are paramount, tools like Sigma Browser are gaining significant attention. Sigma Browser is a privacy-focused web browser designed to provide users with a secure, fast, and ad-free browsing experience. Built with advanced features to protect user data and enhance online anonymity, Sigma Browser is an excellent choice for individuals and businesses alike. In this article, we’ll dive into its features, how it works, benefits, pricing, and more to help you understand why Sigma Browser is a standout in the world of secure browsing.

Features of Sigma Browser AI

Sigma Browser offers a range of features tailored to ensure privacy, speed, and convenience. Here are some of its key features:

  1. Ad-Free Browsing: Enjoy a seamless browsing experience without intrusive ads.
  2. Enhanced Privacy: Built-in privacy tools to block trackers and protect your data.
  3. Fast Performance: Optimized for speed, ensuring quick page loads and smooth navigation.
  4. Customizable Interface: Personalize your browsing experience with themes and settings.
  5. Cross-Platform Sync: Sync your data across multiple devices for a unified experience.
  6. Secure Browsing: Advanced encryption to keep your online activities private.

How It Works

Sigma Browser is designed to be user-friendly while prioritizing security. Here’s how it works:

  1. Download and Install: Simply download Sigma Browser from its official website and install it on your device.
  2. Set Up Privacy Settings: Customize your privacy preferences, such as blocking trackers and enabling encryption.
  3. Browse Securely: Start browsing the web with enhanced privacy and no ads.
  4. Sync Across Devices: Log in to your account to sync bookmarks, history, and settings across multiple devices.
  5. Regular Updates: The browser receives frequent updates to improve performance and security.

Benefits of Sigma Browser AI

Using Sigma Browser comes with numerous advantages:

  • Improved Privacy: Protects your data from third-party trackers and advertisers.
  • Faster Browsing: Eliminates ads and optimizes performance for quicker loading times.
  • User-Friendly: Easy to set up and use, even for non-tech-savvy individuals.
  • Cross-Device Compatibility: Access your browsing data on any device.
  • Customization: Tailor the browser to suit your preferences and needs.

Pricing

Sigma Browser offers flexible pricing plans to cater to different users:

  • Free Version: Includes basic features like ad-free browsing and privacy protection.
  • Premium Plan: Unlocks advanced features such as cross-device sync and priority support. Pricing details are available on the official website.

Sigma Browser Review

Sigma Browser has received positive feedback from users for its focus on privacy and performance. Many appreciate its ad-free experience and the ability to customize the interface. The cross-platform sync feature is also a standout, making it a convenient choice for users who switch between devices. Some users have noted that the premium plan could offer more features, but overall, Sigma Browser is highly regarded for its security and ease of use.

Conclusion

Sigma Browser is a powerful tool for anyone looking to enhance their online privacy and browsing experience. With its ad-free interface, robust privacy features, and fast performance, it stands out as a reliable choice in the crowded browser market. Whether you’re a casual user or a business professional, Sigma Browser offers the tools you need to browse securely and efficiently. Give it a try and experience the difference for yourself.

The post Sigma Browser appeared first on AI Parabellum.

Blogger

Sigma Browser

by: aiparabellum.com
Tue, 28 Jan 2025 07:28:06 +0000


In the digital age, where online privacy and security are paramount, tools like Sigma Browser are gaining significant attention. Sigma Browser is a privacy-focused web browser designed to provide users with a secure, fast, and ad-free browsing experience. Built with advanced features to protect user data and enhance online anonymity, Sigma Browser is an excellent choice for individuals and businesses alike. In this article, we’ll dive into its features, how it works, benefits, pricing, and more to help you understand why Sigma Browser is a standout in the world of secure browsing.

Features of Sigma Browser AI

Sigma Browser offers a range of features tailored to ensure privacy, speed, and convenience. Here are some of its key features:

  1. Ad-Free Browsing: Enjoy a seamless browsing experience without intrusive ads.
  2. Enhanced Privacy: Built-in privacy tools to block trackers and protect your data.
  3. Fast Performance: Optimized for speed, ensuring quick page loads and smooth navigation.
  4. Customizable Interface: Personalize your browsing experience with themes and settings.
  5. Cross-Platform Sync: Sync your data across multiple devices for a unified experience.
  6. Secure Browsing: Advanced encryption to keep your online activities private.

How It Works

Sigma Browser is designed to be user-friendly while prioritizing security. Here’s how it works:

  1. Download and Install: Simply download Sigma Browser from its official website and install it on your device.
  2. Set Up Privacy Settings: Customize your privacy preferences, such as blocking trackers and enabling encryption.
  3. Browse Securely: Start browsing the web with enhanced privacy and no ads.
  4. Sync Across Devices: Log in to your account to sync bookmarks, history, and settings across multiple devices.
  5. Regular Updates: The browser receives frequent updates to improve performance and security.

Benefits of Sigma Browser AI

Using Sigma Browser comes with numerous advantages:

  • Improved Privacy: Protects your data from third-party trackers and advertisers.
  • Faster Browsing: Eliminates ads and optimizes performance for quicker loading times.
  • User-Friendly: Easy to set up and use, even for non-tech-savvy individuals.
  • Cross-Device Compatibility: Access your browsing data on any device.
  • Customization: Tailor the browser to suit your preferences and needs.

Pricing

Sigma Browser offers flexible pricing plans to cater to different users:

  • Free Version: Includes basic features like ad-free browsing and privacy protection.
  • Premium Plan: Unlocks advanced features such as cross-device sync and priority support. Pricing details are available on the official website.

Sigma Browser Review

Sigma Browser has received positive feedback from users for its focus on privacy and performance. Many appreciate its ad-free experience and the ability to customize the interface. The cross-platform sync feature is also a standout, making it a convenient choice for users who switch between devices. Some users have noted that the premium plan could offer more features, but overall, Sigma Browser is highly regarded for its security and ease of use.

Conclusion

Sigma Browser is a powerful tool for anyone looking to enhance their online privacy and browsing experience. With its ad-free interface, robust privacy features, and fast performance, it stands out as a reliable choice in the crowded browser market. Whether you’re a casual user or a business professional, Sigma Browser offers the tools you need to browse securely and efficiently. Give it a try and experience the difference for yourself.

The post Sigma Browser appeared first on AI Parabellum.

by: Chris Coyier
Mon, 27 Jan 2025 17:10:10 +0000


I love a good exposé on how a front-end team operates. Like what technology they use, why, and how, particularly when there are pain points and journeys through them.

Jim Simon of Reddit wrote one a bit ago about their teams build process. They were using something Rollup based and getting 2-minute build times and spent quite a bit of time and effort switching to Vite and now are getting sub-1-second build times. I don’t know if “wow Vite is fast” is the right read here though, as they lost type checking entirely. Vite means esbuild for TypeScript which just strips types, meaning no build process (locally, in CI, or otherwise) will catch errors. That seems like a massive deal to me as it opens the door to all contributions having TypeScript errors. I admit I’m fascinated by the approach though, it’s kinda like treating TypeScript as a local-only linter. Sure, VS Code complains and gives you red squiggles, but nothing else will, so use that information as you will. Very mixed feelings.

Vite always seems to be front and center in conversations about the JavaScript ecosystem these days. The tooling section of this year’s JavaScript Rising Stars:

Vite has been the big winner again this year, renewing for the second time its State of JS awards as the most adopted and loved technology. It’s rare to have both high usage and retention, let alone maintain it. We are eagerly waiting to see how the new void(0) company will impact the Vite ecosystem next year!

(Interesting how it’s actually Biome that gained the most stars this year and has large goals about being the toolchain for the web, like Vite)

Vite actually has the bucks now to make a real run at it. It’s always nail biting and fascinating to see money being thrown around at front-end open source, as a strong business model around all that is hard to find.

Maybe there is an enterprise story to capture? Somehow I can see that more easily. I would guess that’s where the new venture vlt is seeing potential. npm, now being owned by Microsoft, certainly had a story there that investors probably liked to see, so maybe vlt can do it again but better. It’s the “you’ve got their data” thing that adds up to me. Not that I love it, I just get it. Vite might have your stack, but we write checks to infrastructure companies.

That tinge of worry extends to Bun and Deno too. I think they can survive decently on momentum of developers being excited about the speed and features. I wouldn’t say I’ve got a full grasp on it, but I’ve seen some developers be pretty disillusioned or at least trepidatious with Deno and their package registry JSR. But Deno has products! They have enterprise consulting and various hosting. Data and product, I think that is all very smart. Mabe void(0) can find a product play in there. This all reminds me of XState / Stately which took a bit of funding, does open source, and productizes some of what they do. Their new Store library is getting lots of attention which is good for the gander.

To be clear, I’m rooting for all of these companies. They are small and only lightly funded companies, just like CodePen, trying to make tools to make web development better. 💜

by: Andy Clarke
Mon, 27 Jan 2025 15:35:44 +0000


Honestly, it’s difficult for me to come to terms with, but almost 20 years have passed since I wrote my first book, Transcending CSS. In it, I explained how and why to use what was the then-emerging Multi-Column Layout module.

Hint: I published an updated version, Transcending CSS Revisited, which is free to read online.

Perhaps because, before the web, I’d worked in print, I was over-excited at the prospect of dividing content into columns without needing extra markup purely there for presentation. I’ve used Multi-Column Layout regularly ever since. Yet, CSS Columns remains one of the most underused CSS layout tools. I wonder why that is?

Holes in the specification

For a long time, there were, and still are, plenty of holes in Multi-Column Layout. As Rachel Andrew — now a specification editor — noted in her article five years ago:

“The column boxes created when you use one of the column properties can’t be targeted. You can’t address them with JavaScript, nor can you style an individual box to give it a background colour or adjust the padding and margins. All of the column boxes will be the same size. The only thing you can do is add a rule between columns.”

She’s right. And that’s still true. You can’t style columns, for example, by alternating background colours using some sort of :nth-column() pseudo-class selector. You can add a column-rule between columns using border-style values like dashed, dotted, and solid, and who can forget those evergreen groove and ridge styles? But you can’t apply border-image values to a column-rule, which seems odd as they were introduced at roughly the same time. The Multi-Column Layout is imperfect, and there’s plenty I wish it could do in the future, but that doesn’t explain why most people ignore what it can do today.

Patchy browser implementation for a long time

Legacy browsers simply ignored the column properties they couldn’t process. But, when Multi-Column Layout was first launched, most designers and developers had yet to accept that websites needn’t look the same in every browser.

Early on, support for Multi-Column Layout was patchy. However, browsers caught up over time, and although there are still discrepancies — especially in controlling content breaks — Multi-Column Layout has now been implemented widely. Yet, for some reason, many designers and developers I speak to feel that CSS Columns remain broken. Yes, there’s plenty that browser makers should do to improve their implementations, but that shouldn’t prevent people from using the solid parts today.

Readability and usability with scrolling

Maybe the main reason designers and developers haven’t embraced Multi-Column Layout as they have CSS Grid and Flexbox isn’t in the specification or its implementation but in its usability. Rachel pointed this out in her article:

“One reason we don’t see multicol used much on the web is that it would be very easy to end up with a reading experience which made the reader scroll in the block dimension. That would mean scrolling up and down vertically for those of us using English or another vertical writing mode. This is not a good reading experience!”

That’s true. No one would enjoy repeatedly scrolling up and down to read a long passage of content set in columns. She went on:

“Neither of these things is ideal, and using multicol on the web is something we need to think about very carefully in terms of the amount of content we might be aiming to flow into our columns.”

But, let’s face it, thinking very carefully is what designers and developers should always be doing.

Sure, if you’re dumb enough to dump a large amount of content into columns without thinking about its design, you’ll end up serving readers a poor experience. But why would you do that when headlines, images, and quotes can span columns and reset the column flow, instantly improving readability? Add to that container queries and newer unit values for text sizing, and there really isn’t a reason to avoid using Multi-Column Layout any longer.

A brief refresher on properties and values

Let’s run through a refresher. There are two ways to flow content into multiple columns; first, by defining the number of columns you need using the column-count property:

Second, and often best, is specifying the column width, leaving a browser to decide how many columns will fit along the inline axis. For example, I’m using column-width to specify that my columns are over 18rem. A browser creates as many 18rem columns as possible to fit and then shares any remaining space between them.

Then, there is the gutter (or column-gap) between columns, which you can specify using any length unit. I prefer using rem units to maintain the gutters’ relationship to the text size, but if your gutters need to be 1em, you can leave this out, as that’s a browser’s default gap.

The final column property is that divider (or column-rule) to the gutters, which adds visual separation between columns. Again, you can set a thickness and use border-style values like dashed, dotted, and solid.

These examples will be seen whenever you encounter a Multi-Column Layout tutorial, including CSS-Tricks’ own Almanac. The Multi-Column Layout syntax is one of the simplest in the suite of CSS layout tools, which is another reason why there are few reasons not to use it.

Multi-Column Layout is even more relevant today

When I wrote Transcending CSS and first explained the emerging Multi-Column Layout, there were no rem or viewport units, no :has() or other advanced selectors, no container queries, and no routine use of media queries because responsive design hadn’t been invented.

We didn’t have calc() or clamp() for adjusting text sizes, and there was no CSS Grid or Flexible Box Layout for precise control over a layout. Now we do, and all these properties help to make Multi-Column Layout even more relevant today.

Now, you can use rem or viewport units combined with calc() and clamp() to adapt the text size inside CSS Columns. You can use :has() to specify when columns are created, depending on the type of content they contain. Or you might use container queries to implement several columns only when a container is large enough to display them. Of course, you can also combine a Multi-Column Layout with CSS Grid or Flexible Box Layout for even more imaginative layout designs.

Using Multi-Column Layout today

Three examples of multi-column page layouts displayed side-by-side featuring a fictional female country musician.
Patty Meltt is an up-and-coming country music sensation. She’s not real, but the challenges of designing and developing websites like hers are.

My challenge was to implement a flexible article layout without media queries which adapts not only to screen size but also whether or not a <figure> is present. To improve the readability of running text in what would potentially be too-long lines, it should be set in columns to narrow the measure. And, as a final touch, the text size should adapt to the width of the container, not the viewport.

A two-column layout of text topped with a large heading that spans both columns.
Article with no <figure> element. What would potentially be too-long lines of text are set in columns to improve readability by narrowing the measure.
To column layout with text on the left and a large image on the right.
Article containing a <figure> element. No column text is needed for this narrower measure.

The HTML for this layout is rudimentary. One <section>, one <main>, and one <figure> (or not:)

<section>
  <main>
    <h1>About Patty</h1>
    <p>…</p>
  </main>

  <figure>
    <img>
  </figure>
</section>

I started by adding Multi-Column Layout styles to the <main> element using the column-width property to set the width of each column to 40ch (characters). The max-width and automatic inline margins reduce the content width and center it in the viewport:

main {
  margin-inline: auto;
  max-width: 100ch;
  column-width: 40ch;
  column-gap: 3rem;
  column-rule: .5px solid #98838F;
}

Next, I applied a flexible box layout to the <section> only if it :has() a direct descendant which is a <figure>:

section:has(> figure) {
  display: flex;
  flex-wrap: wrap;
  gap: 0 3rem;
}

This next min-width: min(100%, 30rem) — applied to both the <main> and <figure> — is a combination of the min-width property and the min() CSS function. The min() function allows you to specify two or more values, and a browser will choose the smallest value from them. This is incredibly useful for responsive layouts where you want to control the size of an element based on different conditions:

section:has(> figure) main {
  flex: 1;
  margin-inline: 0;
  min-width: min(100%, 30rem);
}

section:has(> figure) figure {
  flex: 4;
  min-width: min(100%, 30rem);
}

What’s efficient about this implementation is that Multi-Column Layout styles are applied throughout, with no need for media queries to switch them on or off.

Adjusting text size in relation to column width helps improve readability. This has only recently become easy to implement with the introduction of container queries, their associated values including cqi, cqw, cqmin, and cqmax. And the clamp() function. Fortunately, you don’t have to work out these text sizes manually as ClearLeft’s Utopia will do the job for you.

My headlines and paragraph sizes are clamped to their minimum and maximum rem sizes and between them text is fluid depending on their container’s inline size:

h1 { font-size: clamp(5.6526rem, 5.4068rem + 1.2288cqi, 6.3592rem); }

h2 { font-size: clamp(1.9994rem, 1.9125rem + 0.4347cqi, 2.2493rem); }

p { font-size: clamp(1rem, 0.9565rem + 0.2174cqi, 1.125rem); }

So, to specify the <main> as the container on which those text sizes are based, I applied a container query for its inline size:

main {
  container-type: inline-size;
}

Open the final result in a desktop browser, when you’re in front of one. It’s a flexible article layout without media queries which adapts to screen size and the presence of a <figure>. Multi-Column Layout sets text in columns to narrow the measure and the text size adapts to the width of its container, not the viewport.

Modern CSS is solving many prior problems

A two-column layout of text with a large heading above it spanning both columns.
Structure content with spanning elements which will restart the flow of columns and prevent people from scrolling long distances.
Same two-column text layout, including an image in the first column.
Prevent figures from dividing their images and captions between columns.

Almost every article I’ve ever read about Multi-Column Layout focuses on its flaws, especially usability. CSS-Tricks’ own Geoff Graham even mentioned the scrolling up and down issue when he asked, “When Do You Use CSS Columns?”

“But an entire long-form article split into columns? I love it in newspapers but am hesitant to scroll down a webpage to read one column, only to scroll back up to do it again.”

Fortunately, the column-span property — which enables headlines, images, and quotes to span columns, resets the column flow, and instantly improves readability — now has solid support in browsers:

h1, h2, blockquote {
  column-span: all; 
}

But the solution to the scrolling up and down issue isn’t purely technical. It also requires content design. This means that content creators and designers must think carefully about the frequency and type of spanning elements, dividing a Multi-Column Layout into shallower sections, reducing the need to scroll and improving someone’s reading experience.

Another prior problem was preventing headlines from becoming detached from their content and figures, dividing their images and captions between columns. Thankfully, the break-after property now also has widespread support, so orphaned images and captions are now a thing of the past:

figure {
  break-after: column;
}

Open this final example in a desktop browser:

You should take a fresh look at Multi-Column Layout

Multi-Column Layout isn’t a shiny new tool. In fact, it remains one of the most underused layout tools in CSS. It’s had, and still has, plenty of problems, but they haven’t reduced its usefulness or its ability to add an extra level of refinement to a product or website’s design. Whether you haven’t used Multi-Column Layout in a while or maybe have never tried it, now’s the time to take a fresh look at Multi-Column Layout.


Revisiting CSS Multi-Column Layout originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

Important Information

Terms of Use Privacy Policy Guidelines We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.