CSS Logos: Nike logo

I'm a full-stack developer from South Africa 🇿🇦. I love writing about JavaScript, HTML and CSS.
Search for a command to run...

I'm a full-stack developer from South Africa 🇿🇦. I love writing about JavaScript, HTML and CSS.
Glad you enjoyed it Emilio 🙌
Most of you know me for my consistency, a golden arrow in my blog series. I've written 1000 articles in 1008 days! Almost an article a day, and my honeymoon was the only holiday I ever took. I'm super proud of this achievement; it has been a fantasti...

It's not the first time I'll be talking about community. I think it's an essential aspect of any successful tool. This shows in my previous explorations of Astro, Medusa, and now Vendure as well. All these products thrive in a super open, welcoming, ...

The cool part about Vendure is how easy it is to set up and how abstract each layer is. Basically, we get the following elements: External database Server Worker Admin UI Frontend While this is amazing, it also brings a bit of complexity when it co...

The previous article looked at customizing Vendure on a data and process level. In this article, we'll look at customizing emails, as they are often a big part of a webshop system. We'll be looking at two different layers of customization for customi...

Even though Vendure is a pretty significant project out of the box, in some cases, we might want to go in and modify some elements to work to our specific use case. In this article, I'll take a high-level look at some elements we can customize within...

In today's article, we'll recreate the iconic Nike swoosh logo.
For reference, this is what the logo looks like:

The Nike swoosh is quite iconic, and the main thing we see is one big ellipsis, with another one overlapping it.
This is all captured in a box so it won't show the overlap. To draw this out, this is what I mean.

As we see in the image, the logo has three items.
blue box: The container, the only thing in here, will become visiblered element: This ellipsis shape will be our actual logoyellow element: This is what we'll use to cut out the excess inside the swoosh.To start, we'll only need one div, which makes things easier.
<div class="nike"></div>
We want to make this relative to the viewport for the blue box container so our logo will scale.
I'm using a custom aspect-ratio to get them off rectangle shape.
.nike {
position: absolute;
overflow: hidden;
width: 50vmin;
aspect-ratio: 14/5;
position: relative;
}
Then we can start defining the red element, which will become our logo.
We want to make a box that is way bigger than our container.
We'll use the :before selector to create this element.
.nike {
&:before {
content: '';
position: absolute;
background: black;
width: 37%;
height: 550%;
bottom: -134%;
left: 70.5%;
border-top-left-radius: 48% 17%;
border-top-right-radius: 120% 40%;
transform: rotate(-113deg);
z-index: 1;
}
}
As you can see, the primary magic here is in the border-radius. We are using the double border radius, which is quite tricky. And it took me a lot of tweaking to get the shape right.
If you want a more visual tester, I found this fantastic tool.
So far, we have the following in play.

This is already looking great. The last thing we need is to cut out the inner part of the logo.
For this, we'll use the :after pseudo-selector.
.nike {
&:after {
content: '';
position: absolute;
background: white;
width: 30%;
height: 400%;
bottom: -73%;
left: 64%;
border-top-left-radius: 64% 14%;
border-top-right-radius: 125% 46%;
transform: rotate(-105deg);
z-index: 2;
}
}
The setup is very similar as we use the double border-radius again and offset the element to the right position.
You can see the final result in this CodePen.
Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on Facebook or Twitter