Live data from Hacker News

Show HN: Mimic – class-fied inline CSS

peterchon.github.io

31–40 of 74 posts

Re: Show HN: Mimic – class-fied inline CSS

#32

I don't think this is a joke. I think this is just something that probably isn't useful as a library/framework/whatever + maybe an incomplete understanding of how CSS best fits into the puzzle.

Thanks for taking a look. As mentioned, it's not a framework - it's a way for me to add simple styling without having to find/add/replace existing class. It may not seem useful to you as a complete solution like bootstrap - but when writing custom directives, it really helped me.

Re: Show HN: Mimic – class-fied inline CSS

#33

Earlier quoted context omitted.

Although bear in mind that bootstrap still does class="alert alert-danger" so they disagree slightly on that point.

If you're using sass you just extend alert inside alert-danger. No need for two classes.

But then you'll create bloat. Multiple classes assigned to an element is far more efficient then repeating properties with the same values over multiple classes in the stylesheet.

Re: Show HN: Mimic – class-fied inline CSS

#34
post #11

I feel like this is akin to "killing the patient to cure the disease." In the uses I can see for this, the way this framework solves the problem, to me, seems to be worse than any problem itself. Namely, I would like to know how this is any better than !important on your CSS properties. Firstly, you're messing up your separation of concerns, you're also messing up an attribute with values that other developers will p…

Hi, thanks for taking a look. Could you tell me why this won't work without JS?

My motivation to write this is because I always have to go back and make quick margin/padding/etc changes and I hated trying to come up with more class names.

As mentioned, this isn't a framework. It was a way for me to add styles when writing styles to custom directives.

Re: Show HN: Mimic – class-fied inline CSS

#35
post #2

Could you please elaborate a bit more on how a class "padding:10" is better than just adding an inline style "padding:10px"?

Hi, thanks for taking a look.

I don't think it's a "better" way, I wanted to explore another way of adding quick styles without having to come up with a class name.

Re: Show HN: Mimic – class-fied inline CSS

#36
post #8
post #7

Earlier quoted context omitted.

I'd presume because you can do browser-specific hacks/normalization with classes but not inline styles. I don't really see the point of all of this, either, though. Maybe it's satire?

It must be effective satire, my blood boils with the possibility it's an honest attempt.

Hi, I'm sorry that I gave you such stress - it wasn't my intention. It would be helpful if you could explain why it caused you such angst.

Re: Show HN: Mimic – class-fied inline CSS

#37

Hey, this is a very radical approach. I have great respect for people who ship something (anything!), because they have the vision to see things differently and actually execute this vision. This may take some getting used to, and a lot of debate if using this is really worth it, but it's something. Nice job! :)

I appreciate your kind words. It's always tough to put things out there for scrutiny.

Re: Show HN: Mimic – class-fied inline CSS

#38
post #12

When doing things like this, you should take ie into consideration http://spaceninja.com/2015/03/31/ie-css-limits/ Using parker ( https://github.com/katiefenn/parker ) tool to analyze the css: curl http://peterchon.github.io/mimic/css/mimic.css -s | parker -s PARKER-JS Total Stylesheets: 1 Total Stylesheet Size: 126045 Total Rules: 2551 Total Selectors: 2611 Total Identifiers: 5292 Total Declarations: 3849 Selectors…

Interesting - I'll take a look.

Re: Show HN: Mimic – class-fied inline CSS

#39
post #33

Earlier quoted context omitted.

If you're using sass you just extend alert inside alert-danger. No need for two classes.

But then you'll create bloat. Multiple classes assigned to an element is far more efficient then repeating properties with the same values over multiple classes in the stylesheet.

Extending is not a mixin. Extend creates a bookmark (not repeating styles).

Re: Show HN: Mimic – class-fied inline CSS

#40
post #9

How do you handle advanced selectors? Or hover states? Or priority? Or inheritance? There is a lot of reasons why separating content and styling is benefitial to both the designer and the developer. And why semantic classes, especially with tools like Sass where abstraction and reusability are key, allow to describe the content, not define its looks. That's why we went from color="red" to style="color:red;" to class=…

Hi, thanks for taking a look.

I'm not trying to be bootstrap. I wanted a way for users to add css without using an inline-css. As for psudo selectors, it's still easy: .do-this-on-hover:hover { ... }

Post reply on HN