Hello, I'm Stanko, a software engineer in Belgrade, making digital products and generative art.
As you probably noticed I redesigned my blog and added some new features. This is a list of the new stuff.
Before modern frameworks, I always used jQuery’s scrollTo
method. At some point, not every project included jQuery, so I wrote simple function to animate window scroll.
I have kept copying that function from project to project. Finally I took some time, cleaned it up and published it on the npm (this is the first npm package I published).
We’ve all been there - trying to get right font sizes from PhotoShop to CSS. Designers usually work with points, which are used in the print, but not common on the web. They also use term tracking a lot, which is actually only a letter spacing with different units.
You can recalculate everything by hand and try to keep track of it. But we can use the goodies of SCSS to make that process a bit easier.
Point to pixel ratio is 1pt = 1.333333px
. We’ll create SASS function to do conversion for us.
And PhotoShop tracking works relative to the font size. One point of tracking is 1/1000 of the font size. For this one we’ll create a mixin.
Always try to use <button>
when element is clickable, but it is not a link. Avoid <a>
, <span>
, <div>
and other elements.
Note that display: flex
works differently on buttons in different browsers, but we have easy fix for that.
I decided to move my CSS playground to the CodePen, and this is the first one I made.
Idea came to me while I was riding on a bus, and I might use it on this blog, as a part of it’s redesign.
This is CSS only animation (I used JS to create 50 elements though). And you can see the usage of SASS random()
function.