Getting Started with Myth: the Preprocessor of the Future

I work on a ~9000 page website where SASS is used, so yes I think this project is big enough.

I have used preprocessors before.

I’ve never refuted any of your benefits that you are listing so I’m not sure why you feel the need ot remind me of them.

It seems that a straight-forward find/replace using a regular expression would do the job well there.

Find: border:(.)#30353b(.)
Replace: border:\1#30353f\2

Hm, can you do that in a text editor? Will have to try it.

Not in a simple editor like Notepad, but Notepad++ has the feature

OK, you can search in Sublime via regular expressions, too, but I’m darned if I know how to write them. Probably easier just to search the file manually!

Sacrilege!
You can use tools such as regexr to help you compose them, or just ask in the forums.
They’re not difficult once you get the hang of them and save a ton of manual labour!

I don’t know if there’s a better reason to start learning about regular expressions than this one :slight_smile:

Here’s something that could help: Sublime Text 2: Find and Replace with Regular Expressions for Idiots

1 Like

Or css preprocessors… :smiley:

1 Like

whenever a new tool appears ,people start shifting to it just because ,as a long standing web developer i learned to stick to tools that have a long support and community ,as long as it works why would i need to reprogram my mind to use a new tool that’s going to give me the same result as my current one.

1 Like

Sorry, I didn’t intend to offense you. I just wanted to know why you think CSS Preprocessors are so bad, but as you seem to acknowledge the advantages of them, I probably just misunderstood your posts :slight_smile:

No offense taken! I was simply pointing out my opinion. Likewise, I hope I didn’t offend you. It’s hard for people to read tones on the Internet so it’s easy to be insulted :slight_smile: . Nothing I said was meant to have any offense to it.

I don’t think they are bad per say, I just find them unnecessary.

We’ve gone years and years without the need for them, now people treat it like it’s a limb attached to their body.

Guys, you should take a look to cssnext.

Why ?

  • more features
  • less bugs
  • a lot faster
  • better error & warning.

Note: upgrading from myth to cssnext should not bring any issue.

I have to agree wholeheartedly with this. SASS gives you access to loops and true logical computations (if/else etc). I’ve found these to be invaluable in creating things like on-demand grids which as far as I can see just wouldn’t be possible with this.

I believe that computational logic such as calculation of dimensions based on variables is slated for future inclusion, but SASS gives me that capability now and without the need to worry about whether the syntax is going to change suddenly in a month.

As far as the arguments against having to learn a “new language”… I would argue that anyone working on any remotely enterprise-scale websites or webapps would probably already have at least some exposure to preprocessors - There’s just too much time saved by using them for dev teams working on projects of that kind of scale to ignore. They not only make the initial code faster to write, but increase maintainability as well.

1 Like

Ugh Yuk!!! That’s the proposed variable syntax for css?! Ugh nooo! That’s awful…

They’re big reason for not bringing in variables before was it would make it more complicated so instead they bring in the most convoluted syntax unlike any other programming languages syntax. So if someone learns variables through css frst (which is likely) they’ll need to unlearn it when moving to javascript or php or something else.

That’s a travesty! It could have just been something like:

–text_color: #fff;

.color {
color: --text_color;
}

1 Like

Ugh Yuk!!! That’s the proposed variable syntax for css?! Ugh nooo! That’s awful…

I also don’t like the proposed syntax for CSS variables. I prefer the syntax in Sass and Less.

However, there’s big value in the concept of CSS variables. CSS variables is one of the reasons why I believe preprocessors have become popular. I might not agree with W3C’s proposed syntax, but I want CSS variables.

1 Like

I’ve been looking forward to them for a long time, but sometimes I do wonder if they will be as much of a pain as not having them. If lots of elements use a variable, and then you want to change some of them—potentially over and over—it seems it would be as much of a pain to sift through the CSS file to change variable names as it would be to change styles declared inline in the first place.

I see it being a problem on the forums and helping people out. I honestly believe this will come down to planning (running into your problem) I think any instance of what you are saying comes down to being poorly prepared.

There might be exceptions that I’m not thinking about though.

I see this time and time again with my clients and no matter how well you think you have everything structured the client will request something that simply cannot be handled by simply changing a variable.

I often set up up a theme for a client with the standard colours defined but more often than not the client will change their mind and decide that they want some items a different colour although they may be the same structural item. In the end you have to trawl through the css and make individual changes which is easier without variables in place.

1 Like

I want CSS variables too but they could have made the syntax more “translatable” to other common languages.

What they done here isn’t a variable…it’s a function returning a value.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.