Frontend

Explore frontend development's latest trends, techniques, frameworks, and libraries.

  • Frontend

    How to Convert CSS Units to Numeric Values

    In CSS, font sizes are typically defined using various units such as pixels (px), ems (em), or percentages (%). These units allow for flexible and responsive typography on the web. However, there may be cases where you need to work with font sizes as numeric values rather than units. Understanding how to convert CSS units to numeric values can provide you with greater control and precision over font size manipulation. For example, in mobile development, it is common to set the root font size in this manner: In this case, what should be the actual value of <p>? In the past, we could only obtain it through JS, but now,…

  • Frontend

    Get started with CSS Scroll-driven Animations

    In the latest version of Chrome 115, the highly anticipated CSS Scroll-driven animations are now officially supported. With this feature, almost any interaction that previously required JavaScript to listen for scrolling can now be achieved purely with CSS. Introduction to APIs may not be very interesting, so let’s first get a sense of it through a straightforward example. Below is a page progress indicator that changes as the page is scrolled. Full code: Isn’t it very simple? If you’re interested, you can continue reading below. CSS Scroll-driven Animations It is well-known that traditional JS scroll event listeners have some issues, as follows: Therefore, in order to address the problem of…

  • Frontend,  Tools

    Top Micro Frontend Frameworks for Web

    In this post, we will share micro frontend frameworks for web development that enable teams to work independently, adopt different technologies, and deliver seamless user experiences. With the widespread application of Single Page Application (SPA), a new issue arises: the need for scalability in applications. On one hand, the rapid increase in functionality leads to proportional increases in packaging time, while urgent releases require shorter times, creating a contradiction. On the other hand, when a codebase integrates all functionalities, daily collaboration becomes extremely challenging. Moreover, in the past decade, frontend technology has rapidly evolved, with a new era emerging every two years, necessitating colleagues to upgrade projects or even switch…

  • Frontend,  Tools

    Best React Guided Tour Libraries for User Onboarding

    When a new version of a product is released or new features are launched, it is often necessary to provide new user guidance to help users understand the application. In the following, we will share the best react guided tour libraries for user onboarding, which can assist in quickly implementing new user guidance functionality. React Joyride Showcase your app to new users or explain functionality of new features. View the demo here (or the codesandbox examples). Read the docs. It uses react-floater for positioning and styling. And you can use your own components too! In React projects, this tool is readily available for introducing new features to existing users. It possesses the following characteristics: 1. User-friendly…

  • Frontend

    Discover Resources How To Block Rendering

    External resources commonly found on web pages include scripts, stylesheets, fonts, images, and videos. It is important to understand how these external resources impact the rendering of the entire page. Prepare Before conducting the test, it is necessary to control the download speed of the browser and reset it to 50kb/s. The procedure for doing so is as follows: 1. Open the Chrome Developer Tools. 2. Navigate to the Network panel. Select “Add” to add a custom throttling configuration. 3. Create a configuration with a download speed of 50kb/s. 4. Finally, select the newly created configuration from the dropdown menu in step 2. 5. Note: If the currently selected custom…

  • Frontend

    Change Text Color in CSS based on Background

    We will discover how to change text color in CSS based on background color in this article. In projects, it is common to encounter scenarios where the background color is uncertain. In order to ensure that the content text is sufficiently clear and visible, there needs to be sufficient contrast between the text and the background. In other words, when the background is dark, as illustrated below: In typical scenarios, it is common to calculate the grayscale of a background color using JavaScript. The algorithm for this calculation is well-known. If the RGB values of a color are known, the grayscale value can be obtained using the following method. This…

  • Frontend

    How to create Chrome-Style Tabs Using CSS

    In this article, we will explore a step-by-step guide on how to create Chrome-style tabs using CSS, allowing you to elevate your web design skills and deliver a seamless browsing experience for your users. How can this be achieved? The following section will present two approaches. Pseudo-element One possible approach to consider is utilizing two pseudo-elements for concatenation. In order to achieve reverse rounded corners on the left and right sides, one can consider utilizing styles that enable the creation of circular shapes. One such style is the “border-radius” property. The following steps can be taken to implement this approach: 1. Draw a transparent circle. 2. Apply a sufficiently large…

  • Frontend

    10 Examples of Conic Gradients

    With CSS conic-gradient, you can now effortlessly design stunning circular color gradients that span 360 degrees, allowing for seamless transitions and captivating visual effects. Whether you want to create dynamic backgrounds, circular progress bars, or eye-catching radial patterns, conic-gradient opens up a world of possibilities for web designers and developers. In this article, we will present 10 examples of conic gradients. In this manner, a conical radiating pattern can be obtained. Pie chart: In addition to the aforementioned, what other patterns can be depicted? The following section will present several practical examples. Triangle Before the emergence of conical gradients, linear gradients could also be used to create triangles, but only…

  • Frontend

    Create a Chrome Logo using HTML and CSS

    Here’s an example introduction that includes how to create a Chrome logo using HTML and CSS. Decomposition of Graphs The chrome logo can be deconstructed into several distinct graphical elements, as illustrated below. radial-gradient The central circle exhibits a gradient transition from blue to white, followed by a transparent hue, and is further complemented by an underlying orange color. This outcome can be achieved: In this context, the term “closest-side” is employed to refer to the nearest edge. The default value is “farthest-side”. Further options are elaborated upon below. value description closest-side The termination position is determined by the closest edge of the container to the gradient center. closest-corner The…

  • Frontend

    New Twitter Logo (X) in Pure CSS

    In this tutorial, I will create a new twitter logo (X) in pure css. Recently, Twitter unveiled a new logo, replacing the blue bird with an “X”, as depicted below. The rendering of x The entire logo consists of a hollow “x” shape. Disregarding the hollow portion, how can a solid “x” be rendered? There are three types of gradients: linear gradient, radial gradient, and conical gradient. It is evident that the x element can be viewed as a line segment with inclined ends, thus a linear gradient is sufficient. Assuming the HTML structure is as follows, an x element. Next, a diagonal line is drawn using a linear gradient, which transitions from…