As explained by @thornekin, the code in the CSS (SCSS) tab of that CodePen example is SCSS.
That same tab has a menu that is accessible by selecting the small V to the right of the tab’s name, which allows access to the View Compiled CSS option. Selecting that option will change the SCSS code being displayed into CSS, which you can then copy into the Story Stylesheet area of your Twine project.
NOTE:
If you use the View Compiled HTML option in the HTML tab to see the HTML elements required to implement the effect, you will notice that it requires multiple <div> elements to be added to the current page to make the effect work.
It may take some effort to convert that example into one that works within the main “story” area of a SugarCube based project.