css

Ventajas de CSS al posicionamiento Web

Con CSS se logra aumentar la densidad de las palabras clave dentro de los contenidos, ya que muchas de las etiquetas ocuparán muchísimo menos espacio. Esto también supone un menor peso para las páginas Web, lo cual agradecen tanto los robots de búsqueda como los usuarios finales. Adicionalmente se podrá cambiar rápidamente los estilos de ciertas palabras, modificando la importancia que les quieres otorgar ante los robots de búsqueda...




css

sonyEricsson

Sony Ericsson Sony Mobile Offers




css

CSS is so Frustrating

Writing webpages in HTML (Hypertext Markup Language) was simple. You learned a few tags and use a simple text-based HTML editor to create it.

But then, along came the "experts" who said you have to split off the content from the styling. The content goes into the HTML file and the styling goes into the CSS (Cascading Style Sheet) file.

In theory that's fine. But why did they have to make CSS ten times as complicated as it had to be? Yes they want to make it more powerful, but they made it so much more difficult. I shouldn't have to struggle to be able to figure out how to do something. It should be clear cut. Although, I must say after two weeks of heavy-duty working with it, I've learned a lot and finally have developed my own style for my pages.

But the real difficulty is that they've made it so complicated that all the different browsers still don't implement everything the same way. Developing table-less columns and CSS-based borders around the content doesn't take long to do. But debugging it in Internet Explorer and Firefox and then trying to tweak it just right so that it looks the same is very frustrating. Once everything starts to look good, I try something else, like print-previewing, and it leads to more head-banging-on-wall. Then I go back in time and try to look at it in Netscape 4.7 and it looks God-awful. That's the price I guess, of moving forward to current standards.

I keep saying to myself that this is all worthwhile. The style sheets can then be applied to my Behold blog, forum, purchase page and help file, and it should all look the same. And I only have to go through the "pain" of developing it once.




css

Ericsson sees AI apps creating demand for dedicated 5G price plans

(Telecompaper) People adopting the new genAI applications may be willing to pay more for 5G connectivity, a new report from Ericsson's ConsumerLab suggests...




css

Ericsson ziet vraag naar speciale 5G-tarieven door AI-apps

Mensen die de nieuwe genAI-toepassingen gebruiken, zijn mogelijk bereid om meer te betalen voor 5G-connectiviteit, suggereert een nieuw rapport van Ericsson's ConsumerLab...




css

Ericsson urges African governments to support school internet access

(Telecompaper) Ericsson has urged governments to play a key role in developing strategies that support internet access and online education...




css

Vorige week in telecom: Ericsson, Nokia worstelen zich door tragere capex-cyclus, RedCap komt op de markt en veranderingen bij Tele2

Nog geen tekenen van een opleving in de markt voor netwerkapparatuur, op basis van de kwartaalresultaten van Ericsson en Nokia, terwijl Netflix wist te verrassen met een hogere omzet, zelfs met een seizoensgebonden vertraging in de klantengroei...




css

Learn Printer Friendly CSS Tricks

Gilbert Jorgensen from ITS will demonstrate at this month's eDG meeting how to set up a Web page so that it can be automatically reformatted as a printer friendly page. Several agency pages will be used as part of the demonstration. The eDG meeting provides a venue where State Web Developers can learn about State development standards and new initiatives. This eDG meeting will be Wednesday, Jan 21, 2004, 2 - 4 PM in State Office Building, Rm. B110.




css

Top 7 CSS3 Games ruling the World of Web Games

If you are into the World of Web Development then you might be aware of the great innovations that are happening in the gaming industry. If you are among those people who have the enthusiasm to create their own web games in that case you might be aware of the novel technologies such as HTML5, …

Top 7 CSS3 Games ruling the World of Web Games Read More »




css

css list-style-type with parentheses

Tags:





css

HTML/CSS. How to create vertical and horizontal menu

This tutorial will show you how to create a vertical and horizontal menus in HTML using CSS styles. Before you proceed please make sure you are familiar with unordered list HTML tags. Also please check the tutorial on how to

The post HTML/CSS. How to create vertical and horizontal menu appeared first on Template Monster Help.




css

Synthesis, mol­ecular and crystal structure of [(NH2)2CSSC(NH2)2]2[RuBr6]Br2·3H2O

The title compound, bis­[di­thio­bis­(formamidinium)] hexa­bromido­ruthenium dibromide trihydrate, [(NH2)2CSSC(NH2)2]2[RuBr6]Br2·3H2O, crystallizes in the ortho­rhom­bic system, space group Cmcm, Z = 4. The [RuBr6]2− anionic complex has an octa­hedral structure. The Ru—Br distances fall in the range 2.4779 (4)–2.4890 (4) Å. The S—S and C—S distances are 2.0282 (12) and 1.783 (2) Å, respectively. The H2O mol­ecules, Br− ions, and NH2 groups of the cation are linked by hydrogen bonds. The conformation of the cation is consolidated by intra­molecular O—H⋯Br, O—H⋯O, N—H⋯Br and N—H⋯O hydrogen bonds. The [(NH2)2CSSC(NH2)2]2+ cations form a hydrogen-bonded system involving the Br − ions and the water mol­ecules. Two Br − anions form four hydrogen bonds, each with the NH2 groups of two cations, thus linking the cations into a ring. The rings are connected by water mol­ecules, forming N—H⋯O—H⋯Br hydrogen bonds.




css

Ericsson, Intel team up on 5G development in Malaysia with eye on enterprise use cases

Amongst the areas that Ericsson and Intel have identified for collaboration is the joint development of enterprise use cases in selected verticals such as manufacturing, transport and logistics.




css

Marquis Who's Who Honors Taurino TJ Trevino, CCNA, CSSA, CEH, for Expertise in Engineering and Operations

Taurino TJ Trevino is a respected logistics professional and dedicated civic servant




css

CSS Welcomes Lorin Cook

Lorin Cook Joins CSS as Managing Director, Industry Solutions




css

Jennifer A. Cody-Schwartz, MSN, RN, CNOR, CSSM Celebrated for Dedication to the Field of Nursing

Jennifer Cody-Schwartz lends years of expertise to her work with Kaiser Permanente




css

Build an Infinite Horizontal Scrolling Logo Display With Pure CSS

Creating an infinite horizontal logo scroll effect with pure CSS is a simple yet powerful way to add dynamic movement to a website. This tutorial will walk you through building an infinite scroll effect with added hover effects that allow the user to pause scrolling and scale each logo slightly when hovered.




css

Create a breakout game with HTML, CSS, and vanilla JavaScript

Let’s create a Breakout game using Vanilla JavaScript. In a Breakout game, the player uses a paddle to bounce a ball and hit bricks, removing the bricks one by one.




css

7 tools to make CSS coding easier

Border radius Border radius is one of the most used CSS properties, but to achieve the desired effect you have to type a bunch of code so can get it to work in all browsers. This tool will allow you to do this in seconds, just type the value you like and it will generate […]




css

The best CSS frameworks out there

In this article I am going to present you one of the best CSS frameworks you can find. When starting a new project as a frontend developer you will always have to face the fact that you will have to write a lot of CSS just to achieve the basic structure of the site. Creating […]




css

Be A Perfect Web Designer Using CSS3 Tutorials

Today I have decided to share with you CSS3 tutorials especially if you are a beginner, basically CSS3 is also requires professional skills but if you’ll concentrate on below CSS3 tutorials you can easily become professional in this field...

View and Vote




css

How CSS Enhances User Experience in Online Gaming

The world of online casinos is now more competitive than ever before. This forces online casinos to push the limits of technology and come up with unique designs focused on improving the user experience.

Since most of such platforms offer similar [...]

Read Article

The post How CSS Enhances User Experience in Online Gaming first appeared on CSS Reset.




css

Create 3D Card Hover Pure CSS Effect

In the realm of web design, the pure 3D Card Hover CSS Effect stands as a testament to the power of CSS3 and its ability to transform user experiences. This ...




css

Fluid Breakout Layout with CSS Grid

So you're building a site and you've got a nice containing element around your content — but wait! Not all the content is the same width! That nice, neat tube of content is not so much a straight tube as a pile of different sized bricks.

It's a common layout problem, but how do we account for these 'breakout' widths in the layout? There's a couple ways we could go about it:

  • Encapsulate each component and set widths and margins. (Works fine if you have full control but can be fiddly).
  • Force the component out of the containing element with negative margins. (Works fine if there's only a little deviation).
  • Use CSS Grid to build a fluid universal grid! (????).

That last one is what we'll be exploring: how to use CSS Grid definitions to allow for consistent component sizing across all breakpoints — no media queries required!

This is a technique that's based on Ryan Mulligan's 'Layout Breakouts' which is based on Josh Comeau's 'Full-Bleed Layout' and is especially useful when creating a fully fluid layout. This also pairs well with fluid type techniques resulting in layouts that TRULY scale with the viewport size.

Setting Up the Grid #

Here's the layout we're going to be building:

If we break apart the design, we've got 4 possible widths for components:

  • Full-Width
  • Feature
  • Popout
  • Content

We've also go some special side-anchored elements that 'stick' to one of the screen edges but also honor the other element widths. We'll come back to these later on.

Now that we've categorized the widths, lets start drawing column edges and defining areas:

  1. Left margin / Full-Width
  2. Left Feature
  3. Left Popout
  4. Center Content
  5. Right Popout
  6. Right Feature
  7. Right margin / Full-Width

That's a lot of columns!

Yet on mobile, we only need 3 columns, just left margin (1), center content (4), and right margin (7). We want some of these intermediate columns to disappear!

Fortunately, CSS Grid gives us some powerful tools to create the measurements needed—yes, even for the disappearing columns! We won't even have to write any media queries for this one. We can make just ONE definition that works at all sizes.

We'll store our measurements as CSS variables for easy use later on:

:root {
  --gap: clamp(1rem, 4vw, 2rem);
  --full: minmax(var(--gap), 1fr);
  --feature: minmax(0, 12vw);
  --popout: minmax(0, 2rem);
  --content: min(clamp(30rem, 52vw, 60rem), 100% - var(--gap) * 2);
}

Let's break these down.

--gap: clamp(1rem, 4vw, 2rem);

gap will be our side margin, allowing it to stretch up to 2rem at max, with a preferred width of 4vw, but never going below 1rem.

--full: minmax(var(--gap), 1fr);

We're going to use the minmax() function for these next three measurements to say: "If there's room in the CSS Grid, you can expand out to here but then don't go smaller than the minimum".

The full area is going to expand from left edge to right edge (remember we have to split the areas to allow for the other columns) and will double as our margin, so we'll pop in our gap value as our minimum and tell it that it can expand up to 1fr, or basically as much space as the rest of the grid will allow it.

--feature: minmax(0, 12vw);
--popout: minmax(0, 2rem);

The feature and popout both have a minimum value of 0. This is what powers our disappearing columns! As other areas of the grid expand, these will collapse when there's no longer any room for them, essentially taking up no space.

--content: min(clamp(30rem, 52vw, 60rem), 100% - var(--gap) * 2);

And then finally, our content area is our most complex measurement. It's saying, take the minimum value of either:

  1. A fluid measurement that can be 30-60rem (with the help of clamp())
  2. OR full width minus our gap value (but doubled for both left and right values).

These measurements can be changed to fit the needs of your layout. Specifically the feature and popout maximum values and the first content value. For example, our use of vw for the feature means it will fluidly expand out as the screen grows whereas the popout will remain only 2rem larger on each side than the content column.

Now we can assemble these measurements in a CSS grid column definition. We'll name our column edges with [custom-ident] and use the -start and -end endings to help make assignment easier later on.

.grid-breakout {
  display: grid;
  grid-template-columns: [full-start] var(--full)
    [feature-start] var(--feature)
    [popout-start] var(--popout)
    [content-start] var(--content) [content-end]
    var(--popout) [popout-end]
    var(--feature) [feature-end]
    var(--full) [full-end];
}

The definition is complex, but if we visualize the start and end lines of our columns as well as the measurements, it looks like this:

You can see we have our middle content column, our disappearing feature and popout columns, and finally our full columns that double as our margin.

To finish off the definitions, we need to create column assignments. Because we named our columns with custom identifiers and specified the start and stop lines, we don't have to fiddle with grid numbers. We can assign them directly like:

.full {
  grid-column: full;
}

.feature {
  grid-column: feature;
}

.popout {
  grid-column: popout;
}

.content {
  grid-column: content;
}

And if we want to create a default assignment for elements in the grid (which is especially useful if you don't have full control over the markup) you can create one like this:

.grid-breakout > * {
  grid-column: content;
}

Now you can attach any of these classes to components in your grid and have them snap to the width you want.

Watch the screen capture below as the grid scales down. You can see the feature and popout columns disappearing as everything transitions to a mobile width, and then expands back up.

You can see a demo of the base setup here:

Nesting Grids #

Now let's go back to our header element. You can see that though the header is full-width, we actually want its inner content to honor the feature width.

Fortunately, because of the flexible nature of this grid definition, we can repeat the definition and then continue using the same column names on the inner structure. Because our grid only goes one layer deep we're free to replicate as much as we need or even break out and use different layout methods for the component interiors.

<main class="grid-breakout">
  <section class="full grid-breakout">
     <div class="feature">
        <!-- inner content -->
     </div>
  </section>
</main>

You can see it in action here:

Anchoring Left and Right #

Remember those side-anchored components? This is where we need to get a little tricky to line everything up.

Going back to our diagram, we want an element to span MOST of the way across the page, but end at the opposite feature edge. We can reuse our column definitions for the first part.

.feature-left {
  grid-template-columns: full-start / feature-end;
}

Great! That gives us exactly what we want... except for when we try to nest the grids.

Our original grid definition assumes that our content, while different widths, is centered in the window. We have to rethink our inner grid definition a little bit.

We're shaving off one end of the grid, specifically a full definition. So two things need to happen:

  1. We need to adjust our content width to now account for only having one gap.
  2. We need our new grid end to stop at the edge of the feature column.

We can achieve this with a new measurement and a new grid definition:

:root {
  /* previous definitions... */
  --content-inset: min(clamp(30rem, 52vw, 60rem), 100% - var(--gap));
}

.grid-breakout-feature-left {
  display: grid;
  grid-template-columns:
    [full-start] var(--full)
    [feature-start] var(--feature)
    [popout-start] var(--popout)
    [content-start] var(--content-inset) [content-end]
    var(--popout) [popout-end]
    var(--feature) [feature-end full-end];
}

We've replaced the inner content measurement with the new value and combined the feature and full ends with the final line of the template column definition:

[feature-end full-end]

This will allow redefinition inside the new side-anchored component. You will notice that you'll need to supply your own padding for the inner as they no longer have that final margin to prevent it from reaching the new grid edge.

<main class="grid-breakout">
  <section class="feature-left grid-breakout-feature-left">
    <div class="feature">
      <!-- inner content -->
    </div>
  </section>
</main>

If you want to reverse this to be anchored to the right, you can flip the grid definition, moving the double start to the top like:

.grid-breakout-feature-right {
  display: grid;
  grid-template-columns:
    [full-start feature-start] var(--feature)
    [popout-start] var(--popout)
    [content-start] var(--content-inset) [content-end]
    var(--popout) [popout-end]
    var(--feature) [feature-end]
    var(--full) [full-end];
}

You can see a demo of the side-anchored component here:

But What About Tailwind! #

We love using Tailwind at Viget as a Team Accelerator™, and it's straightforward to implement these measurements and definitions in your Tailwind config.

/** @type {import('tailwindcss').Config} */
import plugin from "tailwindcss/plugin";

export default {
  // the rest of your other definitions
  theme: {
    // the rest of your theme definitions
    extend: {
      gridColumn: {
        content: "content",
        popout: "popout",
        feature: "feature",
        full: "full",
        "feature-left": "full-start / feature-end",
      },
      gridTemplateColumns: {
        breakout: `[full-start] var(--full)
            [feature-start] var(--feature)
            [popout-start] var(--popout)
            [content-start] var(--content) [content-end]
            var(--popout) [popout-end]
            var(--feature) [feature-end]
            var(--full) [full-end]`,
        "breakout-feature-left": `[full-start] var(--full)
            [feature-start] var(--feature)
            [popout-start] var(--popout)
            [content-start] var(--content-inset) [content-end]
            var(--popout) [popout-end]
            var(--feature) [feature-end full-end];`,
      },
    },
  },
  plugins: [
    plugin(function ({ addBase }) {
      addBase({
        ":root": {
          // grid sizing variables
          "--gap": "clamp(1rem, 4vw, 2rem)",
          "--full": "minmax(var(--gap), 1fr)",
          "--content": "min(clamp(30rem, 52vw, 60rem), 100% - var(--gap) * 2)",
          "--popout": "minmax(0, 2rem)",
          "--feature": "minmax(0, 12vw)",
          "--content-inset": "min(clamp(30rem, 52vw, 60rem), 100% - var(--gap))",
        },
        // force unspecified content blocks into 'content' grid
        ".grid-cols-breakout > *": {
          "grid-column": "content",
        },
      });
    }),
  ],
};

Everything is effectively the same, but you'll call your grid classes like grid-cols-breakout to set the grid, and your columns like col-feature per Tailwind naming conventions.

Forwards to a Fluid Future! #

And there you have it! A media-query-less fluid breakout layout defined with CSS grid!

While the setup is more complicated at first glance, I've found that the more fluid your layout rules are, the FEWER rules you have to write overall! Especially when paired with fluid type, dynamic viewport units, and all the amazing features that are landing in CSS — it's truly a fluid future!



  • Code
  • Front-end Engineering

css

It’s Time To Talk About “CSS5”

Have you ever wondered what happened after CSS3? It’s common knowledge that we never saw CSS4 come after it, yet we have a plethora of new features that have no similar way of defining when they were introduced. The W3C CSS-Next community group is actively searching for better approaches for how we describe the evolution of CSS over time and identify feature sets as effectively as we did with CSS3 way back in 2009 — and you can help.




css

CSS min() All The Things

Victor Ayomipo experiments with the CSS `min()` function, exploring its flexibility with different units to determine if it is the be-all, end-all for responsiveness. Discover the cautions he highlights against dogmatic approaches to web design based on his findings.




css

GSTP-CSS - The composite source signal as a measuring signal and a summary of various investigations on speech echo cancellers

GSTP-CSS - The composite source signal as a measuring signal and a summary of various investigations on speech echo cancellers




css

Advanced Data Systems Launches MedicsSpeak and MedicsListen

MedicsSpeak and MedicsListen support voice-to-text data input and real-time conversational clinical data capture.




css

Ericsson leveraging acquired assets to beef up enterprise strategy

Under the new leadership of Matt Cook, Ericsson’s enterprise 5G strategy is leveraging the large partner channel obtained in the Vonage, Cradlepoint and Ericom acquisitions, as well as the enterprise-focused solutions they sold, to boost their enterprise sales.




css

ICS-in-CSS

International Code of Signals Flags in the Browser – is an HTML/CSS implementation for the flags of The International Code of Signals (ICS), a system of signals and codes designed to communicate important safety and navigational messages when speaking is difficult, for use by vessels to communicate important messages regarding safety of navigation and related matters.

The project is published as open source, including a React plugin (ics-css-react) available in NPM, for all your phonetic alphabet enthusiasts who want to add flags to your site :)

[Link




css

Las Oficinas De La División De Servicios De Manutención Infantil (DCSS Por Sus Siglas En Ingles) Cerrarán Sept 23

NEW CASTLE (Septiembre 19, 2022) – Las oficinas de la División de Servicios de Manutención Infantil (DCSS por sus siglas en Ingles) estarán cerradas en los tres condados el Viernes, 23 de Septiembre, debido a una reunión de personal en servicio. Los clientes de manutención infantil que tienen asuntos para resolver en persona se les […]




css

Sony Ericsson Vivaz Pro: Loses 8MP camera, gets a keyboard - at Rs. 24,585 Review

Read the in depth Review of Sony Ericsson Vivaz Pro: Loses 8MP camera, gets a keyboard - at Rs. 24,585 Mobile Phones. Know detailed info about Sony Ericsson Vivaz Pro: Loses 8MP camera, gets a keyboard - at Rs. 24,585 configuration, design and performance quality along with pros & cons, Digit rating, verdict based on user opinions/feedback.




css

Angular Removing Unused CSS and Obfuscate JavaScript in Post Build Process

Nowadays most applications are developed based on large CSS libraries like Bootstrap, Tailwind CSS, etc.. and sometimes multiple frameworks. But your application components are not using all of the styles and it adds more weight to the application performance. This post will explain the Angular post-build process to remove unused CSS and hidden JavaScript files that enhance the application security and definitely improve the app loading time and save the overall bandwidth cost.





css

React Removing Unused CSS and Obfuscate JavaScript in Post Build Process

This is continues of my previous post about how to remove unused CSS and convert unclear JavaScript to protect your source code in the post-build process. If you are using CSS libraries like Bootstrap, Tailwind CSS, etc.. and sometimes multiple frameworks. But your application components are not using all of the styles and it adds more weight to the application performance. This post will explain how to configure the React post-build process to remove unused CSS and hidden JavaScript files that enhance the application security and definitely improve the app loading time and save the overall bandwidth cost.






css

AutoGrow Textareas with CSS

As the demands of the web change and developers experiment with different user experiences, the need for more native language improvements expands. Our presentation layer, CSS, has done incredibly well in improving capabilities, even if sometimes too slow. The need for native support for automatically expanding textarea elements has been long known…and it’s finally here! […]

The post AutoGrow Textareas with CSS appeared first on David Walsh Blog.




css

How to Override width and height HTML attributes with CSS

One of the HTML elements that frequently comes into collision with CSS is the img element. As we learned in Request Metrics’ Fixing Cumulative Layout Shift Problems on DavidWalshBlog article, providing image dimensions within the image tag will help to improve your website’s score. But in a world where responsive design is king, we need […]

The post How to Override width and height HTML attributes with CSS appeared first on David Walsh Blog.




css

Case Insensitive CSS Attribute Selector

CSS selectors never cease to amaze me in how powerful they can be in matching complex patterns. Most of that flexibility is in parent/child/sibling relationships, very seldomly in value matching. Consider my surprise when I learned that CSS allows matching attribute values regardless off case! Adding a {space}i to the attribute selector brackets will make […]

The post Case Insensitive CSS Attribute Selector appeared first on David Walsh Blog.




css

Ericsson expects network densification to drive next phase of growth in India

Ericsson estimates that the data traffic in India will grow from 29 GB per smartphone user per month to 68 GB per smartphone user per month by 2029




css

Getting Started with CSS Shapes: Wrapping content around custom paths

Using CSS Shapes we can create experiences that we have never been able to create on the web before.




css

Be curious, spend time on important stuff, says Ericsson CEO Vestberg




css

Ericsson, ST split joint venture




css

Mobile-First CSS: Is It Time for a Rethink?

The mobile-first design methodology is great—it focuses on what really matters to the user, it’s well-practiced, and it’s been a common design pattern for years. So developing your CSS mobile-first should also be great, too…right? 

Well, not necessarily. Classic mobile-first CSS development is based on the principle of overwriting style declarations: you begin your CSS with default style declarations, and overwrite and/or add new styles as you add breakpoints with min-width media queries for larger viewports (for a good overview see “What is Mobile First CSS and Why Does It Rock?”). But all those exceptions create complexity and inefficiency, which in turn can lead to an increased testing effort and a code base that’s harder to maintain. Admit it—how many of us willingly want that?

On your own projects, mobile-first CSS may yet be the best tool for the job, but first you need to evaluate just how appropriate it is in light of the visual design and user interactions you’re working on. To help you get started, here’s how I go about tackling the factors you need to watch for, and I’ll discuss some alternate solutions if mobile-first doesn’t seem to suit your project.

Advantages of mobile-first

Some of the things to like with mobile-first CSS development—and why it’s been the de facto development methodology for so long—make a lot of sense:

Development hierarchy. One thing you undoubtedly get from mobile-first is a nice development hierarchy—you just focus on the mobile view and get developing. 

Tried and tested. It’s a tried and tested methodology that’s worked for years for a reason: it solves a problem really well.

Prioritizes the mobile view. The mobile view is the simplest and arguably the most important, as it encompasses all the key user journeys, and often accounts for a higher proportion of user visits (depending on the project). 

Prevents desktop-centric development. As development is done using desktop computers, it can be tempting to initially focus on the desktop view. But thinking about mobile from the start prevents us from getting stuck later on; no one wants to spend their time retrofitting a desktop-centric site to work on mobile devices!

Disadvantages of mobile-first

Setting style declarations and then overwriting them at higher breakpoints can lead to undesirable ramifications:

More complexity. The farther up the breakpoint hierarchy you go, the more unnecessary code you inherit from lower breakpoints. 

Higher CSS specificity. Styles that have been reverted to their browser default value in a class name declaration now have a higher specificity. This can be a headache on large projects when you want to keep the CSS selectors as simple as possible.

Requires more regression testing. Changes to the CSS at a lower view (like adding a new style) requires all higher breakpoints to be regression tested.

The browser can’t prioritize CSS downloads. At wider breakpoints, classic mobile-first min-width media queries don’t leverage the browser’s capability to download CSS files in priority order.

The problem of property value overrides

There is nothing inherently wrong with overwriting values; CSS was designed to do just that. Still, inheriting incorrect values is unhelpful and can be burdensome and inefficient. It can also lead to increased style specificity when you have to overwrite styles to reset them back to their defaults, something that may cause issues later on, especially if you are using a combination of bespoke CSS and utility classes. We won’t be able to use a utility class for a style that has been reset with a higher specificity.

With this in mind, I’m developing CSS with a focus on the default values much more these days. Since there’s no specific order, and no chains of specific values to keep track of, this frees me to develop breakpoints simultaneously. I concentrate on finding common styles and isolating the specific exceptions in closed media query ranges (that is, any range with a max-width set). 

This approach opens up some opportunities, as you can look at each breakpoint as a clean slate. If a component’s layout looks like it should be based on Flexbox at all breakpoints, it’s fine and can be coded in the default style sheet. But if it looks like Grid would be much better for large screens and Flexbox for mobile, these can both be done entirely independently when the CSS is put into closed media query ranges. Also, developing simultaneously requires you to have a good understanding of any given component in all breakpoints up front. This can help surface issues in the design earlier in the development process. We don’t want to get stuck down a rabbit hole building a complex component for mobile, and then get the designs for desktop and find they are equally complex and incompatible with the HTML we created for the mobile view! 

Though this approach isn’t going to suit everyone, I encourage you to give it a try. There are plenty of tools out there to help with concurrent development, such as Responsively App, Blisk, and many others. 

Having said that, I don’t feel the order itself is particularly relevant. If you are comfortable with focusing on the mobile view, have a good understanding of the requirements for other breakpoints, and prefer to work on one device at a time, then by all means stick with the classic development order. The important thing is to identify common styles and exceptions so you can put them in the relevant stylesheet—a sort of manual tree-shaking process! Personally, I find this a little easier when working on a component across breakpoints, but that’s by no means a requirement.

Closed media query ranges in practice 

In classic mobile-first CSS we overwrite the styles, but we can avoid this by using media query ranges. To illustrate the difference (I’m using SCSS for brevity), let’s assume there are three visual designs: 

  • smaller than 768
  • from 768 to below 1024
  • 1024 and anything larger 

Take a simple example where a block-level element has a default padding of “20px,” which is overwritten at tablet to be “40px” and set back to “20px” on desktop.

Classic min-width mobile-first

.my-block {
  padding: 20px;
  @media (min-width: 768px) {
    padding: 40px;
  }
  @media (min-width: 1024px) {
    padding: 20px;
  }
}

Closed media query range

.my-block {
  padding: 20px;
  @media (min-width: 768px) and (max-width: 1023.98px) {
    padding: 40px;
  }
}

The subtle difference is that the mobile-first example sets the default padding to “20px” and then overwrites it at each breakpoint, setting it three times in total. In contrast, the second example sets the default padding to “20px” and only overrides it at the relevant breakpoint where it isn’t the default value (in this instance, tablet is the exception).

The goal is to: 

  • Only set styles when needed. 
  • Not set them with the expectation of overwriting them later on, again and again. 

To this end, closed media query ranges are our best friend. If we need to make a change to any given view, we make it in the CSS media query range that applies to the specific breakpoint. We’ll be much less likely to introduce unwanted alterations, and our regression testing only needs to focus on the breakpoint we have actually edited. 

Taking the above example, if we find that .my-block spacing on desktop is already accounted for by the margin at that breakpoint, and since we want to remove the padding altogether, we could do this by setting the mobile padding in a closed media query range.

.my-block {
  @media (max-width: 767.98px) {
    padding: 20px;
  }
  @media (min-width: 768px) and (max-width: 1023.98px) {
    padding: 40px;
  }
}

The browser default padding for our block is “0,” so instead of adding a desktop media query and using unset or “0” for the padding value (which we would need with mobile-first), we can wrap the mobile padding in a closed media query (since it is now also an exception) so it won’t get picked up at wider breakpoints. At the desktop breakpoint, we won’t need to set any padding style, as we want the browser default value.

Bundling versus separating the CSS

Back in the day, keeping the number of requests to a minimum was very important due to the browser’s limit of concurrent requests (typically around six). As a consequence, the use of image sprites and CSS bundling was the norm, with all the CSS being downloaded in one go, as one stylesheet with highest priority. 

With HTTP/2 and HTTP/3 now on the scene, the number of requests is no longer the big deal it used to be. This allows us to separate the CSS into multiple files by media query. The clear benefit of this is the browser can now request the CSS it currently needs with a higher priority than the CSS it doesn’t. This is more performant and can reduce the overall time page rendering is blocked.

Which HTTP version are you using?

To determine which version of HTTP you’re using, go to your website and open your browser’s dev tools. Next, select the Network tab and make sure the Protocol column is visible. If “h2” is listed under Protocol, it means HTTP/2 is being used. 

Note: to view the Protocol in your browser’s dev tools, go to the Network tab, reload your page, right-click any column header (e.g., Name), and check the Protocol column.

Note: for a summarized comparison, see ImageKit’s “HTTP/2 vs. HTTP/1.”

Also, if your site is still using HTTP/1...WHY?!! What are you waiting for? There is excellent user support for HTTP/2.

Splitting the CSS

Separating the CSS into individual files is a worthwhile task. Linking the separate CSS files using the relevant media attribute allows the browser to identify which files are needed immediately (because they’re render-blocking) and which can be deferred. Based on this, it allocates each file an appropriate priority.

In the following example of a website visited on a mobile breakpoint, we can see the mobile and default CSS are loaded with “Highest” priority, as they are currently needed to render the page. The remaining CSS files (print, tablet, and desktop) are still downloaded in case they’ll be needed later, but with “Lowest” priority. 

With bundled CSS, the browser will have to download the CSS file and parse it before rendering can start.

While, as noted, with the CSS separated into different files linked and marked up with the relevant media attribute, the browser can prioritize the files it currently needs. Using closed media query ranges allows the browser to do this at all widths, as opposed to classic mobile-first min-width queries, where the desktop browser would have to download all the CSS with Highest priority. We can’t assume that desktop users always have a fast connection. For instance, in many rural areas, internet connection speeds are still slow. 

The media queries and number of separate CSS files will vary from project to project based on project requirements, but might look similar to the example below.

Bundled CSS

<link href="site.css" rel="stylesheet">

This single file contains all the CSS, including all media queries, and it will be downloaded with Highest priority.

Separated CSS

<link href="default.css" rel="stylesheet"><link href="mobile.css" media="screen and (max-width: 767.98px)" rel="stylesheet"><link href="tablet.css" media="screen and (min-width: 768px) and (max-width: 1083.98px)" rel="stylesheet"><link href="desktop.css" media="screen and (min-width: 1084px)" rel="stylesheet"><link href="print.css" media="print" rel="stylesheet">

Separating the CSS and specifying a media attribute value on each link tag allows the browser to prioritize what it currently needs. Out of the five files listed above, two will be downloaded with Highest priority: the default file, and the file that matches the current media query. The others will be downloaded with Lowest priority.

Depending on the project’s deployment strategy, a change to one file (mobile.css, for example) would only require the QA team to regression test on devices in that specific media query range. Compare that to the prospect of deploying the single bundled site.css file, an approach that would normally trigger a full regression test.

Moving on

The uptake of mobile-first CSS was a really important milestone in web development; it has helped front-end developers focus on mobile web applications, rather than developing sites on desktop and then attempting to retrofit them to work on other devices.

I don’t think anyone wants to return to that development model again, but it’s important we don’t lose sight of the issue it highlighted: that things can easily get convoluted and less efficient if we prioritize one particular device—any device—over others. For this reason, focusing on the CSS in its own right, always mindful of what is the default setting and what’s an exception, seems like the natural next step. I’ve started noticing small simplifications in my own CSS, as well as other developers’, and that testing and maintenance work is also a bit more simplified and productive. 

In general, simplifying CSS rule creation whenever we can is ultimately a cleaner approach than going around in circles of overrides. But whichever methodology you choose, it needs to suit the project. Mobile-first may—or may not—turn out to be the best choice for what’s involved, but first you need to solidly understand the trade-offs you’re stepping into.




css

Communications, Control Systems and Signal Processing (CCSSP), 2020 1st International Conference on [electronic journal].

IEEE / Institute of Electrical and Electronics Engineers Incorporated




css

2020 IEEE 6th International Conference on Control Science and Systems Engineering (ICCSSE) [electronic journal].

IEEE / Institute of Electrical and Electronics Engineers Incorporated




css

020 1st International Conference on Communications, Control Systems and Signal Processing (CCSSP) [electronic journal].

IEEE / Institute of Electrical and Electronics Engineers Incorporated




css

Syngenta signs MoUs with CSSRI and HAU on crop productivity, sustainable agriculture

MoUs aim to implement projects related to capacity building of rural youth in agriculture and allied sciences, safe use of crop protection chemicals and adoption of new technologies, among other things




css

Fading in a Page on Load with CSS & JavaScript

When I visit a page, I get annoyed when I try to interact with elements while the website is still loading. Often stuff is moving around, fonts aren’t quite loaded, and it feels broken.

I know nowadays we’re obsessed in this industry with gaining every millisecond in page performance. But in a couple of projects that I recently overhauled, I added a subtle and clean loading mechanism that I think makes the experience nicer, even if it does ultimately slightly delay the time that the user is able to start interacting with my page.

The post Fading in a Page on Load with CSS & JavaScript appeared first on Impressive Webs.