Why Choose Bug Bounty Programs? (Benefits and Challenges Explained)

Diligent software developers must follow secure development practices, industry standards, and regulatory requirements when handling software vulnerabilities. Handling vulnerabilities is a complex, multi-step process that involves various methods and stages. One effective approach to finding vulnerabilities is through Bug Bounty programs.

Preparing for a Bug Bounty Program

Before launching a Bug Bounty program, a company should already have established processes for identifying vulnerabilities. It is crucial to have experience working with third-party organizations for code and process security audits, commonly known as penetration testing. Having experience with red teaming is even better.

Choosing the Optimal Data Storage Architecture

Data Warehouse, Data Lake, and Data Lakehouse are the most popular types of data storage architectures that may benefit any business looking to develop its analytics capabilities. Each of them has a set of advantages and best-fit use cases. The most important thing is to choose the data storage approach that best suits your business needs. In this blog post, we'll describe the workings of each solution to help you make a more informed decision.

Data storage architecture is a hot topic in today’s business world as the demand for big data analytics is growing. Businesses generate massive amounts of data and require a robust solution to collect, store, and analyze it effectively. Data storage is the foundation of big data architecture and its components. It provides an environment for storing and serving data and has a direct influence on essential KPIs, such as:

Creating Custom Dashboards With Vizro: A Comprehensive Guide

What Is Vizro?

This information is sourced from the official Vizro GitHub Page.

Vizro is a Python library to create dashboards for your data simply, built on top of Dash and Plotly. It aims to merge the rapid prototyping abilities of Streamlit with the customization capabilities of Dash.

A Vizro Dashboard is made of Pages, with each page mainly comprising Components (which can be Graphs or Tables), Filters (which can be sliders, dropdown boxes, and other buttons), and optional Actions. Together, they can be formatted in native Python as an object, or as a YAML file. In this tutorial, I will be locally developing a Vizro Dashboard using Python. I assume some prior knowledge of the Pandas Library.

Analysis of Flubot Malware on Android OS

Every day, the use of smartphones increases, together with the advancement of the operating system of Android. Subsequently, there have been reports of malicious individuals and hackers capitalizing on the exploits that Android has to offer to gain access to the data that users hold dear. Such threats have included, for instance, the Flubot malware attack that was released for Android devices globally in the year 2021. Notably, this malware targeted banking apps used by victims on their gadgets to carry out the cyberattacks. That is why, with reference to the understanding of the Flubot malware’s signature and behavior, our research focuses on the possible methods of the cyber threat’s future strikes.

Originally, our research included an exploratory analysis of three different samples of Flubot malware found in the free repository of the Hatching Triage platform. 

Chris’ Corner: Let’s Look at Type!

Dan Mall has my favorite post on picking a typeface. I’m no master typographer, but I know enough that I don’t want to be talked to like an absolute beginner where you teach me what a serif is. Dan gets into more realistic decision making steps, like intentionally not picking something ultra popular, admitting that you have to be around a lot of type to make good type decisions, and that ultimately choosing is akin to improvising in jazz: it’s just gotta feel right.

If you are a beginner, or really just like type, you’d do well carving out half an hour to watch the 6 parts of Practicing Typography Basics from Tim Brown who sounds like he’s at absolute zen at all times. Each of these videos only has a few thousand views which feels like a damn shame to me as they are super good and hit all the most important stuff about typography.

Now let’s have more fun and just look at some actual typefaces I’ve bookmarked lately.

MD IO

I just love this so much it’s one of those typefaces that make me want to find a project just to use it on.

Jgs

Jgs Font glyphs can be combined from one character to another, from one line to another. Thus from single characters it is possible to draw continuous lines, frames and patterns.

Nudica

The pricing atipo foundry does for their fonts (“pay what you want”) is awfully generous.

mononoki

a font for programming and code review

I’ve got this on my list of potential fonts to add to CodePen when I get to doing another round of that.

F.C. Variable

An exploration by Rob en Robin about using the axes of variable fonts to control illustrations. Wild!


Oh and kinda just for myself, I want to remember two fonts Dan mentioned. He said he doesn’t pick these as they are almost too popular, but I don’t know them well and that popularity kinda intrigues me honestly.

Two of the most popular typefaces on Typewolf are Grilli Type’s GT America and Lineto’s Circular. You can’t go wrong with those. They look great and they won’t offend anyone.

Navigating the Maze: Evolving Projects and Database Dilemmas

Imagine this: A new project starts with a clear vision and well-structured code. Over time, it takes on a life of its own, growing into a web of features, requirements, and code modules. Despite this growth proves the project’s success, it also increases its complexity, which can become overwhelming if not managed properly. You've heard this story before.

As all of us know, actual programming begins to steer this complexity into a maintainable and scalable form. We need to ensure that the expansion of our project is linear or at least predictable in its complexity. The project’s relational database schema is often a prime battleground for this effort.

CSS Container Queries

Container queries are often considered a modern approach to responsive web design where traditional media queries have long been the gold standard — the reason being that we can create layouts made with elements that respond to, say, the width of their containers rather than the width of the viewport.

.parent {
  container-name: hero-banner;
  container-type: inline-size;

  /* or container: hero-banner / inline-size; */
}

}

.child {
  display: flex;
  flex-direction: column;
}

/* When the container is greater than 60 characters... */
@container hero-banner (width > 60ch) {
  /* Change the flex direction of the .child element. */
  .child { 
    flex-direction: row;
  }
}

Why care about CSS Container Queries?

  1. When using a container query, we give elements the ability to change based on their container’s size, not the viewport.
  1. They allow us to define all of the styles for a particular element in a more predictable way.
  1. They are more reusable than media queries in that they behave the same no matter where they are used. So, if you were to create a component that includes a container query, you could easily drop it into another project and it will still behave in the same predictable fashion.
  1. They introduce new types of CSS length units that can be used to size elements by their container’s size.

Registering Elements as Containers

.cards {
  container-name: card-grid;
  container-type: inline-size;

  /* Shorthand */
  container: card-grid / inline-size;
}

This example registers a new container named card-grid that can be queried by its inline-size, which is a fancy way of saying its “width” when we’re working in a horizontal writing mode. It’s a logical property. Otherwise, “inline” would refer to the container’s “height” in a vertical writing mode.

  • The container-name property is used to register an element as a container that applies styles to other elements based on the container’s size and styles.
  • The container-type property is used to register an element as a container that can apply styles to other elements when it meets certain conditions.
  • The container property is a shorthand that combines the container-name and container-type properties into a single declaration.

Some Possible Gotchas

Querying a Container

@container my-container (width > 60ch) {
  article {
    flex-direction: row;
  }
}
  • The @container at-rule property informs the browser that we are working with a container query rather than, say, a media query (i.e., @media).
  • The my-container part in there refers to the container’s name, as declared in the container’s container-name property.
  • The article element represents an item in the container, whether it’s a direct child of the container or a further ancestor. Either way, the element must be in the container and it will get styles applied to it when the queried condition is matched.

Some Possible Gotchas

Container Queries Properties & Values

Container Queries Properties & Values

container-name

container-name: none | <custom-ident>+;
Value Descriptions
  • none: The element does not have a container name. This is true by default, so you will likely never use this value, as its purpose is purely to set the property’s default behavior.
  • <custom-ident>: This is the name of the container, which can be anything, except for words that are reserved for other functions, including defaultnoneatno, and or. Note that the names are not wrapped in quotes.
  • Initial value: none
  • Applies to: All elements
  • Inherited: No
  • Percentages: N/A
  • Computed value: none or an ordered list of identifiers
  • Canonical order: Per grammar
  • Animation: Not animatable

container-type

container-type: normal | size | inline-size;
Value Descriptions
  • normal: This indicates that the element is a container that can be queried by its styles rather than size. All elements are technically containers by default, so we don’t even need to explicitly assign a container-type to define a style container.
  • size: This is if we want to query a container by its size, whether we’re talking about the inline or block direction.
  • inline-size: This allows us to query a container by its inline size, which is equivalent to width in a standard horizontal writing mode. This is perhaps the most commonly used value, as we can establish responsive designs based on element size rather than the size of the viewport as we would normally do with media queries.
  • Initial value: normal
  • Applies to: All elements
  • Inherited: No
  • Percentages: N/A
  • Computed value: As specified by keyword
  • Canonical order: Per grammar
  • Animation: Not animatable

container

container: <'container-name'> [ / <'container-type'> ]?
Value Definitons

If <'container-type'> is omitted, it is reset to its initial value of normalwhich defines a style container instead of a size container. In other words, all elements are style containers by default, unless we explicitly set the container-type property value to either size or inline-size which allows us to query a container’s size dimensions.

  • Initial value: none / normal
  • Applies to: All elements
  • Inherited: No
  • Percentages: N/A
  • Computed value: As specified
  • Canonical order: Per grammar
  • Animation: Not animatable

Container Length Units

Container Width & Height Units

UnitNameEquivalent to…
cqwContainer query width1% of the queried container’s width
cqhContainer query height1% of the queried container’s height

Container Logical Directions

UnitNameEquivalent to…
cqiContainer query inline size1% of the queried container’s inline size, which is its width in a horizontal writing mode.
cqbContainer query block size1% of the queried container’s inline size, which is its height in a horizontal writing mode.

Container Minimum & Maximum Lengths

UnitNameEquivalent to…
cqminContainer query minimum sizeThe value of cqi or cqb, whichever is smaller.
cqmaxContainer query maximum sizeThe value of cqi or cqb, whichever is larger.

Container Style Queries

Container Style Queries is another piece of the CSS Container Queries puzzle. Instead of querying a container by its size or inline-size, we can query a container’s CSS styles. And when the container’s styles meet the queried condition, we can apply styles to other elements. This is the sort of “conditional” styling we’ve wanted on the web for a long time: If these styles match over here, then apply these other styles over there.

CSS Container Style Queries are only available as an experimental feature in modern web browsers at the time of this writing, and even then, style queries are only capable of evaluating CSS custom properties (i.e., variables).

Browser Support

The feature is still considered experimental at the time of this writing and is not supported by any browser, unless enabled through feature flags.

This browser support data is from Caniuse, which has more detail. A number indicates that browser supports the feature at that version and up.

Desktop

ChromeFirefoxIEEdgeSafari
128NoNo125TP

Mobile / Tablet

Android ChromeAndroid FirefoxAndroidiOS Safari
125No125No

Registering a Style Container

article {
  container-name: card;
}

That’s really it! Actually, we don’t even need the container-name property unless we need to target it specifically. Otherwise, we can skip registering a container altogether.

And if you’re wondering why there’s no container-type declaration, that’s because all elements are already considered containers. It’s a lot like how all elements are position: relative by default; there’s no need to declare it. The only reason we would declare a container-type is if we want a CSS Container Size Query instead of a CSS Container Style Query.

So, really, there is no need to register a container style query because all elements are already style containers right out of the box! The only reason we’d declare container-name, then, is simply to help select a specific container by name when writing a style query.

Using a Style Container Query

@container style(--bg-color: #000) {
  p { color: #fff; }
}

In this example, we’re querying any matching container (because all elements are style containers by default).

Notice how the syntax it’s a lot like a traditional media query? The biggest difference is that we are writing @container instead of @media. The other difference is that we’re calling a style() function that holds the matching style condition. This way, a style query is differentiated from a size query, although there is no corresponding size() function.

In this instance, we’re checking if a certain custom property named --bg-color is set to black (#000). If the variable’s value matches that condition, then we’re setting paragraph (p) text color to white (#fff).

Custom Properties & Variables

.card-wrapper {
  --bg-color: #000;
}
.card {
  @container style(--bg-color: #000) {
    /* Custom CSS */
  }
}

Nesting Style Queries

@container style(--featured: true) {
  article {
    grid-column: 1 / -1;
  }
  @container style(--theme: dark) {
    article {
      --bg-color: #000;
      --text: #fff;
    }
  }
}

Specification

CSS Container Queries are defined in the CSS Containment Module Level 3 specification, which is currently in Editor’s Draft status at the time of this writing.

Browser Support

Browser support for CSS Container Size Queries is great. It’s just style queries that are lacking support at the time of this writing.

  • Chrome 105 shipped on August 30, 2022, with support.
  • Safari 16 shipped on September 12, 2022, with support.
  • Firefox 110 shipped on February 14, 2023, with support.

This browser support data is from Caniuse, which has more detail. A number indicates that browser supports the feature at that version and up.

Desktop

ChromeFirefoxIEEdgeSafari
106110No10616.0

Mobile / Tablet

Android ChromeAndroid FirefoxAndroidiOS Safari
12512612516.0

Demos!

Card Component

In this example, a “card” component changes its layout based on the amount of available space in its container.

Call to Action Panel

This example is a lot like those little panels for signing up for an email newsletter. Notice how the layout changes three times according to how much available space is in the container. This is what makes CSS Container Queries so powerful: you can quite literally drop this panel into any project and the layout will respond as it should, as it’s based on the space it is in rather than the size of the browser’s viewport.

Stepper Component

This component displays a series of “steps” much like a timeline. In wider containers, the stepper displays steps horizontally. But if the container becomes small enough, the stepper shifts things around so that the steps are vertically stacked.

Icon Button

Sometimes we like to decorate buttons with an icon to accentuate the button’s label with a little more meaning and context. And sometimes we don’t know just how wide that button will be in any given context, which makes it tough to know when exactly to hide the icon or re-arrange the button’s styles when space becomes limited. In this example, an icon is displayed to the right edge of the button as long as there’s room to fit it beside the button label. If room runs out, the button becomes a square tile that stacks the icons above the label. Notice how the border-radius is set in container query units, 4cqi, which is equal to 4% of the container’s inline-size (i.e. width) and results in rounder edges as the button grows in size.

Pagination

Pagination is a great example of a component that benefits from CSS Container Queries because, depending on the amount of space we have, we can choose to display links to individual pages, or hide them in favor of only two buttons, one to paginate to older content and one to paginate to newer content.

Articles & Tutorials

General Information

Container Size Query Tutorials

Container Style Queries


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

dovpanda: Unlock Pandas Efficiency With Automated Insights

Writing concise and effective Pandas code can be challenging, especially for beginners. That's where dovpanda comes in. dovpanda is an overlay for working with Pandas in an analysis environment. dovpanda tries to understand what you are trying to do with your data and helps you find easier ways to write your code and helps in identifying potential issues, exploring new Pandas tricks, and ultimately, writing better code – faster. This guide will walk you through the basics of dovpanda with practical examples.

Introduction to dovpanda

dovpanda is your coding companion for Pandas, providing insightful hints and tips to help you write more concise and efficient Pandas code. It integrates seamlessly with your Pandas workflow. This offers real-time suggestions for improving your code.

Sanity Testing vs. Regression Testing: Key Differences

As part of the Software Development Life Cycle (SDLC), different types of testing are performed, each targeting specific elements and aspects of the software application. Among those, sanity and regression testing are two of the most important types of software testing. 

Comparing sanity testing and regression testing, sanity testing is the process that involves a quick test of the software application when it goes through any minor changes to make sure that the software is stable for further testing. When it comes to regression testing, it validates the changes made to the software (fixing bugs, adding features) haven't broken anything and that everything built previously works as expected. 

Does Tools give 100% correct answers?

Hello Everyone!
Let's have a debate about does tools like Semrush, Ahrefs etc give 100% correct information? Like you do not need anything else besides these tools?
I already know the answer just looking for your insights.

JavaScript, Node.js, and Apache Kafka for Full-Stack Data Streaming

JavaScript is a pivotal technology for web applications. With the emergence of Node.js, JavaScript became relevant for both client-side and server-side development, enabling a full-stack development approach with a single programming language. Both Node.js and Apache Kafka are built around event-driven architectures, making them naturally compatible for real-time data streaming. This blog post explores open-source JavaScript clients for Apache Kafka and discusses the trade-offs and limitations of JavaScript Kafka producers and consumers compared to stream processing technologies such as Kafka Streams or Apache Flink.

JavaScript: A Pivotal Technology for Web Applications

JavaScript is a pivotal technology for web applications, serving as the backbone of interactive and dynamic web experiences. Here are several reasons JavaScript is essential for web applications:

Twilio Empowers Developers With Enhanced Data Warehouse Interoperability

In the era of data-driven decision-making, businesses are constantly seeking ways to harness the power of their customer data to deliver personalized experiences. Twilio, the leading customer engagement platform, has taken a significant step forward in this direction with the announcement of Linked Audiences and the debut of the Segment Data Graph at Snowflake Summit 2024. These new product features enhance Twilio Segment's interoperability with data platforms and warehouses, empowering developers, engineers, and architects to unlock the full potential of customer data.

Unlocking the Power of Customer Data

Twilio's Linked Audiences and Segment Data Graph are game-changers for businesses that rely on data platforms and warehouses for managing customer data. By enhancing interoperability between Segment's CDP and data warehouses, Twilio enables businesses to transform static data repositories into dynamic, actionable engines that drive real-time, personalized customer experiences.

Understanding MVP: Striking the Balance Between Minimum and Viable

"Is this feature needed for MVP? Why do we need more budget for our MVP? Why didn't users mention this requirement during MVP definition? Why can't we deliver the MVP faster?" If any of these questions sound familiar, keep reading.

If you've ever been part of an Agile team or involved in technology development, you've likely encountered the term "MVP," or Minimum Viable Product. Despite its seemingly straightforward definition, the concept of MVP often leads to confusion and misapplication. Misunderstanding MVP can cause product failures, as teams may incorrectly prioritize "minimum" over "viable." This article aims to demystify MVP and provide clarity on its true meaning and application in product development.

Exploring WebAssembly for Cloud-Native Development

I’m a senior solution architect and polyglot programmer interested in the evolution of programming languages and their impact on application development. Around three years ago, I encountered WebAssembly (Wasm) through the .NET Blazor project. This technology caught my attention because it can execute applications at near-native speed across different programming languages. This was especially exciting to me as a polyglot programmer since my programming expertise ranges across multiple programming languages including .NET, PHP, Node.js, Rust, and Go.

Most of the work I do is building cloud-native enterprise applications, so I have been particularly interested in advancements that broaden Wasm’s applicability in cloud-native development. WebAssembly 2.0 was a significant leap forward, improving performance and flexibility while streamlining integration with web and cloud infrastructures to make Wasm an even more powerful tool for developers to build versatile and dynamic cloud-native applications. I aim to share the knowledge and understanding I've gained, providing an overview of Wasm’s capabilities and its potential impact on the cloud-native development landscape.

What Is theme.json File in WordPress and How to Use It

Are you using a block theme and seeing the theme.json file in WordPress? Maybe you are wondering what the purpose of this file is and whether you should edit it.

The theme.json file is a crucial part of the full site editing experience in WordPress. As block themes become more widespread, it’s important to understand what theme.json does and how to edit it properly.

That’s why we at WPBeginner have put together this comprehensive guide. In this article, we will explain what a theme.json file is and how you can use it to customize your WordPress site.

What is theme.json File in WordPress and How to Use It

What Is the WordPress theme.json File?

The theme.json file is a special theme file introduced in WordPress 5.8. It plays a key role in the full site editing (FSE) experience, which allows you to visually customize every aspect of your WordPress block theme.

Essentially, the theme.json file acts as a blueprint that controls the styling and functionality of your block theme. It contains code that tells WordPress how different elements like colors, typography, layouts, and templates should look and behave.

Why Do WordPress Block Themes Need a theme.json File?

Editing a block theme in WordPress is different from editing a classic theme.

Classic themes use the functions.php file to enable features like custom menus or featured images with the add_theme_support() function. Then, you can style those features with CSS rules in the CSS stylesheet (style.css) file.

The add theme support function in functions.php

In block themes, theme.json acts as a central hub for everything that defines the look and feel of your block theme. It lets you define things like fonts, colors, and layout options in one place, replacing the need for add_theme_support() in functions.php.

That’s why the functions.php file in block themes is often smaller than the equivalent in classic themes.

Having a dedicated theme.json file offers some great benefits over the previous classic theme system.

First, theme.json works hand-in-hand with the WordPress full site editor. This allows you to easily customize your theme’s styles and settings directly within the editor without needing to touch any code.

Choosing a theme style in the Full Site Editor

Furthermore, theme.json aims to create a consistent experience for both developers and users. Some users find it really frustrating when they need to change themes because they have to learn completely new layouts and styling options.

With theme.json, switching themes becomes a smoother process because everything is organized in a similar way.

Finally, by using theme.json, theme developers and users can future-proof their work as WordPress continues to expand its full site editing capabilities.

Now that we’ve covered what a theme.json file is, let’s delve deeper into the topic. You can use the quick links below to navigate through this guide:

Where Do You Find the WordPress theme.json File?

The theme.json file is found inside your theme directory on your web server. The typical file path would be public_html » wp-content » themes » your-theme-name » theme.json.

To access it, you first need to connect to your site via FTP or your hosting account’s file manager.

If you use Bluehost, then you can log in and switch to the ‘Websites’ tab. Then, click on the ‘Settings’ button below your website.

Bluehost site settings

Now, make sure to stay on the ‘Overview’ tab.

Then, scroll down to click on the ‘File Manager’ button.

Bluehost File Manager button

When you open the file manager this way, you will automatically be inside your website’s root folder.

Here, look for the ‘wp-content’ directory and open it. There, you’ll find the ‘themes’ folder which contains all your installed WordPress themes.

Open the folder for the specific block theme you’re using. The theme.json file will be located directly inside this theme directory alongside other theme files.

theme.json location as seen in Bluehost file manager

Once you have found it, you can view the theme.json file using a code editor.

What Does the theme.json File Look Like?

The theme.json file has a specific structure that organizes all the global settings for your WordPress block theme.

Depending on how complex or simple your theme looks, the file can be very short or long. However, you can easily break this file down into 7 top-level sections:

{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 2,
"settings": {},
"styles": {},
"customTemplates": {},
"templateParts": {},
"patterns": []
}

Here’s a simplified breakdown:

Schema

This part is actually optional to have in block themes, so you may or may not see it in yours.

The schema property links the URL to the WordPress JSON schema, which defines the global settings, styles, and other configurations for your theme.

Version

This section specifies which API version of the theme.json format is being used by the file and ensures it follows the correct structure.

As of the writing of this article, the API is at version 2.

Settings

This property defines the options and controls available for users to customize their theme. These include presets for the theme’s color palette, typography, spacing, gradients, shadows, borders, and so on.

Here’s a very simple example of what the settings property looks like:

{
  "settings": {
    "color": {
      "palette": [
        {
          "slug": "base",
          "color": "#ffffff",
          "name": "White"
        },
        {
          "slug": "contrast",
          "color": "#222222",
          "name": "Dark"
        },
        {
          "slug": "accent",
          "color": "#f08080",
          "name": "Pink"
        },
        {
          "slug": "accent-2",
          "color": "#90ee90",
          "name": "Light Green"
        },
        {
          "slug": "accent-3",
          "color": "#e0ffff",
          "name": "Light Blue"
        }
      ]
    },
    "typography": {
      "fontFamilies": [
        {
          "fontFamily": "Open Sans, sans-serif",
          "slug": "open-sans",
          "name": "Open Sans"
        },
        {
          "fontFamily": "Arial, sans-serif",
          "slug": "arial",
          "name": "Arial"
        },
        {
          "fontFamily": "Times New Roman, serif",
          "slug": "times-new-roman",
          "name": "Times New Roman"
        }
      ],
      "fontSizes": [
        {
          "name": "Extra Small",
          "slug": "xx-small",
          "size": "0.75rem"
        },
        {
          "name": "Small",
          "slug": "small",
          "size": "0.875rem"
        },
        {
          "name": "Medium",
          "slug": "medium",
          "size": "1rem"
        },
        {
          "name": "Large",
          "slug": "large",
          "size": "1.125rem"
        },
        {
          "name": "Extra Large",
          "slug": "x-large",
          "size": "1.25rem"
        },
        {
          "name": "XX-Large",
          "slug": "xx-large",
          "size": "1.5rem"
        }
      ],
      "spacing": {
        "units": ["rem"],
        "values": {
          "small": "1rem",
          "medium": "1.5rem",
          "large": "2rem"
        }
      }
    }
  }
}

If you look at the code, the language used is pretty easy to understand. You can tell that the settings are defining the colors, font families, font sizes, and spacing used in the theme.

If there are any references here or in your theme that you don’t understand, you can check out the official WordPress Settings Reference.

Some elements, like colors and font families, have slugs, like this:

{
  "settings": {
    "color": {
      "palette": [
        {
          "slug": "base",
          "color": "#ffffff",
          "name": "White"
        },

These will come in handy for the styles section later on to make presets, which we will explain in the next part.

Styles

While the settings section defines the theme’s default customization options, the styles section applies them to the theme.

Here, you can apply the customization settings to the entire website or at a block level using presets.

Let’s check out the example below:

{
  "settings": {
    // Existing settings from the previous example
  },
  "styles": {
    "color": {
      "background": "var(--wp--preset--color--base)",
      "text": "var(--wp--preset--color--contrast)"
    },
    "elements": {
      "link": {
        "color": {
          "text": "var(--wp--preset--color--accent-2)"
        }
      },
      "h1": {
        "fontSize": "var(--wp--preset--font-size--xx-large)",
        "lineHeight": "1.2",
        "marginBottom": "1rem"
      },
      "h2": {
        "fontSize": "var(--wp--preset--font-size--x-large)",
        "lineHeight": "1.2",
        "marginBottom": "1rem"
      },
      "h3": {
        "fontSize": "var(--wp--preset--font-size--large)",
        "lineHeight": "1.2",
        "marginBottom": "1rem"
      }
    }
  }
}

As you can tell, there is this line of code appearing throughout this snippet: var(--wp--preset--xxx) . These are presets, which are shortcuts in the styles section that refer back to the values defined in the settings section.

For example, consider {"slug": "base", "color": "#ffffff", "name": "White"} in the settings section. Here, "base" is the slug, and the corresponding preset for this color is var(--wp--preset--color--base) .

Therefore, the code "color": {"background": "var(--wp--preset--color--base)" in styles says that the background color of this theme is white.

Custom Templates

Block theme developers can create predefined layouts for custom pages, posts, or post types for users to use.

For example, the Twenty Twenty-Four theme has several custom templates defined in the theme.json file: Page No Title, Page With Sidebar, Page with wide Image, and Single with Sidebar.

You can use any of these to create your content.

],
"customTemplates": [
  {
    "name": "page-no-title",
    "postTypes": ["page"],
    "title": "Page No Title"
  },
  {
    "name": "page-with-sidebar",
    "postTypes": ["page"],
    "title": "Page With Sidebar"
  },
  {
    "name": "page-wide",
    "postTypes": ["page"],
    "title": "Page with wide Image"
  },
  {
    "name": "single-with-sidebar",
    "postTypes": ["post"],
    "title": "Single with Sidebar"
  }
]

One thing to note is that the theme.json file only references the templates by name and provides metadata about them, such as their title and the post types they are intended for.

However, the actual appearance and functionality of the custom templates are defined in separate template files inside the theme folder.

To see them, you can go to public_html » wp-content » themes » your-theme-name » templates.

The block theme's templates folder seen in Bluehost file manager

Template Parts

Template parts are reusable areas you can apply across your custom templates. These are elements like headers, footers, sidebars, and so on.

Here’s what those template parts look like registered in theme.json:

"templateParts": [
  {
    "area": "header",
    "name": "header",
    "title": "Header"
  },
  {
    "area": "footer",
    "name": "footer",
    "title": "Footer"
  },
  {
    "area": "sidebar",  // Removed "uncategorized"
    "name": "sidebar",
    "title": "Sidebar"
  },
  {
    "area": "post-meta",  // Removed "uncategorized"
    "name": "post-meta",
    "title": "Post Meta"
  }
]

Like custom templates, the theme.json file only references the templates.

Their actual appearance is defined in their own template part files in the parts folder.

The block theme's parts folder seen in Bluehost file manager

Patterns

Patterns are pre-made collections of blocks that let you create custom content layouts on your pages, posts, or anywhere else in your theme.

When you open the full site editor, you may notice the Patterns menu. This is where you can find all the available patterns for your Gutenberg block theme.

The Patterns page in WordPress Full Site Editor

With theme.json, theme developers can reference patterns from the public Pattern directory. It’s a great way to offer more customization options without designing these reusable blocks yourself.

For example, the Twenty Twenty-Four theme references two patterns from the official directory: three columns of services and clients section:

"patterns": [
  "three-columns-of-services",
  "clients-section"
]

We know this because these patterns are in the Patterns menu in the full site editor.

However, they’re not in the patterns folder inside the theme directory.

The block theme's patterns folder as seen in Bluehost file manager

Note: You may notice that the templates, parts, and patterns folders in your theme directory contain files not specified in theme.json, but they’re still visible in the full site editor.

If you’re curious, this is because WordPress is designed to automatically recognize and use these folders based on their naming conventions and location within the theme’s directory.

What You Should Do Before Editing the theme.json File

Since theme.json is a core theme file, editing it directly on your live WordPress website comes with some risk. Accidental mistakes could potentially break your theme or website.

A safer approach is to use a child theme.

A child theme inherits all the styles and functionalities of your parent theme (the block theme you are using) but allows you to customize things without modifying the parent theme itself. This way, if the parent theme receives updates, your customizations won’t be overwritten.

You can read our guide on how to create a child theme in WordPress for more information. This article shows an easy method with the Create Block Theme plugin, which will automatically generate a new theme.json file for your child theme only.

Creating a child theme with Create Block Theme

To ensure a smooth editing experience and avoid any website downtime, we also recommend creating a new backup of your WordPress website. This way, if something goes wrong, you can easily restore your site to its previous state.

We recommend using a plugin like Duplicator for a quick and reliable backup solution.

It’s also recommended to work in a local WordPress development environment or a staging site. This creates a replica of your live website where you can test changes safely without affecting your visitors.

Here are some more tips to keep in mind:

  • Begin with minor edits in your theme.json file and test them thoroughly before making more complex changes.
  • If you’re unsure about any specific property or setting within the theme.json file, consult the official WordPress documentation.
  • Don’t hesitate to seek help from the theme developer’s support team or the WordPress.org support forums if you run into any issues. Check out our guide on how to ask for WordPress support for more information.

How to Edit WordPress theme.json File

Based on our research and testing, we’ve discovered two ways to edit a WordPress theme.json file: using the full-site editor or using code. The first option is much easier and safer and lets you see your modifications from the front end of your website.

Meanwhile, the second choice is recommended if you are comfortable with advanced WordPress development.

Edit theme.json Without Code (Beginners)

To edit your theme.json file without touching the code directly, you can use the Create Block Theme plugin. This plugin was published by the official WordPress.org team to let users create, edit, and save the style variations of their block theme.

First, go ahead and install the WordPress plugin in your admin area. Then, open the full-site editor by going to Appearance » Editor.

Selecting the Full-Site Editor from the WordPress admin panel

You will now see several menus to edit your theme.

Here, select ‘Styles.’

Choosing Styles in the Full Site Editor

Next, click the pencil ‘Edit styles’ icon.

This will take you to the block editor to edit your website’s global styles.

Clicking Edit Styles in Full Site Editor

Now, you can change the style of your theme like normal. You can read the section on how to edit your theme’s global styles in our WordPress full-site editing guide for more information.

Let’s try creating a custom color palette as an example.

The color scheme or palette is a set of default colors for elements like text, backgrounds, and buttons. It ensures a cohesive look throughout your website.

Elements using the same color preset will always match so that your website design looks polished and professional.

To edit the palette, select ‘Colors’ on the Styles settings sidebar.

Editing a block theme's global colors in FSE

On the next screen, you will see some settings to customize your theme’s colors.

Here, click the colors in the ‘Palette’ section.

Opening a block theme's color palette in FSE

In this example, the Twenty Twenty-Four theme has already defined 5 colors in the palette, but you can change any of them to create a custom one from scratch.

To do so, click one of the colors under ‘Theme.’ Then, select any color in the color picker tool.

Changing a block theme's global color in FSE

Now, if you preview your website, you will see that the specific blocks or elements that used the previous color have been replaced with the color you just selected in your palette.

You can repeat the same steps for each color. Then, click ‘Save.’

Saving changes in a block theme in FSE

After saving your changes, click the Create Block Theme button (the wrench icon).

Then, select ‘Save Changes to Theme.’

Saving theme changes to the theme.json file with Create Block Theme

On the next screen, you need to scroll down.

After that, click ‘Save Changes.’ This will prompt WordPress to store all the changes you’ve made to your theme in the theme.json file.

Confirming to save theme changes in Create Block Theme

Once you do that, the block editor will then refresh itself.

Now, click the Create Block Theme button again and select ‘View theme.json.’

Viewing theme.json with Create Block Theme

To see the code for your custom color palette, look for palette that is nested inside color and settings, like so:

"settings": {
  // Some code...
  "color": {
    // Some code...
    "palette":  
  }
}

Under it, you should see the new hex codes of your custom color palette.

Viewing the newly edited theme.json in Create Block Theme

Edit theme.json With Code (Advanced Users)

This method is recommended if you are an aspiring WordPress theme developer or have some experience with code.

First, open your block theme’s theme.json file in your WordPress directory. You can either use the code editor in your web host’s file manager or download the file, edit it on your computer, and upload it back to your server.

We will use the Twenty Twenty-Four theme and Bluehost’s file manager for demonstration purposes. If you are a Bluehost user and are using the file manager, then you can just simply right-click on your theme.json file and click ‘Edit.’

Editing a theme.json file manually with Bluehost file manager

If you use FTP, then you can read our guide on how to use FTP to upload files to WordPress.

Let’s try a simple example of editing your theme.json file: creating custom font sizes.

Again, remember that the settings property specifies your theme’s default styles, whereas the styles property implements them. For this reason, we will edit the settings property in the theme.json file.

If you use a child theme, then you can simply copy and paste the following code into your theme.json file and change the font sizes in pixels as you see fit:

{
  "settings": {
    "typography": {
      "fluid": false,
      "fontSizes": [
        {
          "name": "Small",
          "slug": "small",
          "size": "16px"
        },
        {
          "name": "Medium",
          "slug": "medium",
          "size": "24px"
        },
        {
          "name": "Large",
          "slug": "large",
          "size": "40px"
        },
        {
          "name": "Extra Large",
          "slug": "x-lagrge",  // Typo fixed (large -> large)
          "size": "48px"
        }
      ]
    }
  }
}

Note: If you are editing your parent theme’s file directly, then you need to find the code that says fontSizes .

It should be nested inside typography and settings , like so:

{
  "settings": {
    // Some code...
    "typography": {
      // Some code...
      "fontSizes": [
        // Font size definitions here
      ]
    }
  }
}

After that, replace those lines of code with the code snippet from above. Just make sure that there are no syntax errors in it.

Once done, save the file and preview your website to see your changes. For Bluehost users, you can simply click ‘Save Changes’ in the file manager’s code editor.

Saving changes in the theme.json file in the Bluehost file manager

If you want to edit your theme.json further, we highly encourage getting more familiar with the file’s structure as explained in the previous section.

We also suggest reading the official WordPress Settings Reference, which includes a full list of the available settings properties and instructions for using them.

Bonus Tip: Use WPCode to Add Custom Code to Your Theme

In this guide, you have learned about theme.json and its potential for theme customization. But maybe it still feels a bit overwhelming to edit directly.

Luckily, there’s another user-friendly option for adding custom code and making advanced customizations: WPCode.

With WPCode, you can insert custom code snippets without ever needing to touch your theme files themselves. This significantly reduces the risk of breaking your website during customization.

If you want to learn more about this code snippet plugin, check out our full WPCode review.

Also, here are some helpful tutorials to get you started with using WPCode:

We hope this article helped you learn about the theme.json file in WordPress. You may also want to check out our beginner’s guide on how to edit a WordPress website and our expert pick of the best drag-and-drop page builders for WordPress.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post What Is theme.json File in WordPress and How to Use It first appeared on WPBeginner.