As two patterns, you can use multiple background images, where images are generated by CSS itself.
To draw the circle:
background-image: radial-gradient(circle, yellow 0%, yellow 15%, transparent 15%, transparent 100%)
Just changing the color to the other colors.
See an example:
body {
background-image: radial-gradient(circle, gold 0%, gold 15%, transparent 15%, transparent 100%),
radial-gradient(circle, red 0%, red 15%, transparent 15%, transparent 100%);
background-size: 40px 40px;
background-position: 0 0, 20px 20px;
}
Leaving the most dynamic pattern
If you want to make it a bit more dynamic, you can put the base dimension in a CSS variable and use calc
to calculate the positions. For example:
body {
--size: 20px;
background-image: radial-gradient(circle, gold 0%, gold 15%, transparent 15%, transparent 100%),
radial-gradient(circle, red 0%, red 15%, transparent 15%, transparent 100%);
background-size: var(--size) var(--size);
background-position: 0 0, calc(var(--size)/2) calc(var(--size)/2);
}
Another interesting question about setting patterns in background using images that might be useful to anyone reading this answer is: