Piotr Sikora - Logo - Automatyzacja procesów | AI | JavaScript | Front End | Team Leader
  • Home
  • Services
    • Process Automation
    • AI for Lawyers
  • Blog
  • Quotes
  • Contact
PL/EN

Why I Started Working with Stylus CSS Preprocessor

  • Home
  • Blog
  • Why I Started Working with Stylus CSS Preprocessor
Why I Started Working with Stylus CSS Preprocessor

By Piotr Sikora

  • css

  • 2 min read

Table of Contents

  • Stylus!
  • Why I think that Stylus can improve my workflow?

For last few years I've been working with SASS. I was blindly related to this language after few tests with other CSS precompilators.

Few days ago I started creating project from zero and wanted to make research in this area. Firstly Ive started with SASS but...

The first issue which I had was differences between SASS and SCSS. I love indent based languages like PUG (previously JADE). Those languages are saving time and char numbers in code. But... lets get back to SASS so ... I wanted to have a basic objects which could be than iterated and could create final selectors with proper declarations.

In SASS:

$h1: ( font-size: 40px, font-family: Arial, weight: 100, color: black, text-decoration: none)

As you can see SASS needs this object to be in one line. In case when there would be used SCSS which could cause inconsistency when we will use in some files SASS and in some SCSS it could be multiline objects. But... I started checking if I could do it in some other way.

Stylus!

So using Stylus made my life easier:

$_btn_success = {
  font-family: Arial,
  font-size: 14px,
  font-weight: normal,
  color: white,
  background: blue,
  border-radius: 5px,
  padding: 5px 15px,
  display: inline-block
}

I can keep my object like this. Additionally I can use function for iterating this kind of object like this:

for key, value in hash
    {key}: value

So when I will create a function like:

CreatePropertiesFromHash(hash)
  for key, value in hash
    {key}: value</code>

I can use it to create full descriptions of selectors based on previously created object like:

$_btn_success = {
  font-family: Arial,
  font-size: 14px,
  font-weight: normal,
  color: white,
  background: blue,
  border-radius: 5px,
  padding: 5px 15px,
  display: inline-block
}

CreatePropertiesFromHash(hash)
  for key, value in hash
    {key}: value

.btn--success
  CreatePropertiesFromHash($_btn_success)

This code will be transformed to:

.btn--success {
  font-family: Arial;
  font-size: 14px;
  font-weight: normal;
  color: white;
  background: blue;
  border-radius: 5px;
  padding: 5px 15px;
  display: inline-block;
}

Why I think that Stylus can improve my workflow?

Currently I've switched to this CSS precompilator because of it's simplicity. It can be as easy as SASS or even improved SASS. Of course my previous love to SASS will no rust but changes are showing us another point of view.

After next dose of Stylus I will share my thoughts with You as well!

Try Stylus on your own!

Share this article

TwitterLinkedInFacebook

Tags:

  • #css

  • #preprocessor

  • #stylus

Categories

after-hours(1)AI(7)ai-en(1)angular(4)automatic-tests(1)Automation(2)cryptography(1)css(8)CyberSecurity(2)Development(6)DevOps(1)events(3)javascript(11)n8n(10)ollama(1)security(2)seo(1)

Recent Posts

Testing Kimi Code: First Impressions from Web and CLI

Development

Testing Kimi Code: First Impressions from Web and CLI

Why You Shouldn't Cram Multiple Webhooks Into One n8n Workflow

Automation

Why You Shouldn't Cram Multiple Webhooks Into One n8n Workflow

DRY, WET, AHA: Finding the Right Balance in Code Reuse

Development

DRY, WET, AHA: Finding the Right Balance in Code Reuse

API vs Webhook: Understanding the Difference

Development

API vs Webhook: Understanding the Difference

RTCROS Framework: Structure Your Prompts for Better AI Results

AI

RTCROS Framework: Structure Your Prompts for Better AI Results

About Me

Piotr Sikora - Process Automation | AI | n8n | Python | JavaScript

Piotr Sikora

Process Automation Specialist

I implement automation that saves time and money, streamlines operations, and increases the predictability of results. Specializing in process automation, AI implementation, and workflow optimization using n8n, Python, and JavaScript.

n8n Workflows

n8n workflow automation templates

Explore my workflow templates on n8n. Ready-to-use automations for blog management, data collection, and AI-powered content processing.

3Workflow Templates
View Templates

• Auto-Categorize Blog Posts with AI

• Collect LinkedIn Profiles

• Export WordPress Posts for SEO

Tags

activepiecesafter-hoursahrefsaiAI cost reductionai-agentsai-automationangularantigravityapiAqua Securityarcade-gamesarchitectureautomationbackendbest-practicescadillacs-and-dinosaurschatbotchatgptCI/CD
“The whole thing is simply this: when you want to strike your enemy dead, you must cut so that he dies, by no means taking as your goal what the strike should be like: strong or weak”
Musashi Miyamoto
View more quotes

Similar Articles

Discover more related content

Master SASS Installation with This Quick Guide

Master SASS Installation with This Quick Guide

Ever dreamed of variables or functions in CSS? The easiest way to get them is by using a preprocessor like SASS.

3 April 2014
Pure CSS Collapsible Elements: Create Accordion

Pure CSS Collapsible Elements: Create Accordion

Learn how to create collapsible elements and accordion components using pure CSS-no JavaScript needed

Front-End Developer Interview Questions Part 1

Front-End Developer Interview Questions Part 1

Essential CSS and HTML interview questions for front-end developers. Quick skill assessment guide for headhunters and candidates.

Piotr Sikora | ai | n8n | javascript | python

Let's get to know each other!

Get in touch with me
Piotr Sikora | Process Automation  | AI Implementation 🤖 | Technology Consulting
Quick links
  • Home
  • Blog
  • Contact
Contact
  • piotr.sikora.ck@gmail.com
  • +48 505 684 661

© Piotr Sikora 2026 | All Rights Reserved