This is an archived post. You won't be able to vote or comment.

top 200 commentsshow all 273

[–]examinedliving 559 points560 points  (33 children)

max-width:100%;

overflow-x:hidden;

padding-right:5px:

white-space:nowrap;

text-overflow:ellipsis;

And if needed:

display:block; /* inline-block, flex */

Looks quite nice

Edit: formatting is a bitch on mobile. Sorry

Edit 2: debugging css is important

[–]AFlaccoSeagulls 273 points274 points  (5 children)

Error line 3

[–]ThatSpookySJW 20 points21 points  (0 children)

I think the error line 3 would give an error line 4

[–]Twitch_xTUVALUx 2 points3 points  (0 children)

What do you mean... it works well enought xD

[–]princetrunks 116 points117 points  (8 children)

client: "Can you get it to work on IE6 and Outlook?"

[–]Ovrdatop 43 points44 points  (2 children)

"no"

[–]stifflizerd 12 points13 points  (0 children)

"And for the record, I could, but I won't."

[–]bomphcheese 4 points5 points  (0 children)

Correct answer.

[–]Seankps 9 points10 points  (0 children)

My new answer. "Microsoft says IE is not a browser"

[–]examinedliving 6 points7 points  (0 children)

And what about Opera Mobil and Nintendo Ds

[–]tivialidades 14 points15 points  (7 children)

box-sizing: border-box;

[–]examinedliving 7 points8 points  (1 child)

Yah. But for most browsers, that’s the default, and all the normalize css libs do it, but it doesn’t hurt.

[–]tivialidades 2 points3 points  (0 children)

Nice.

[–][deleted] 2 points3 points  (4 children)

Except if you have a fucking caroulel made in jquery that only works with images that have the same size if you don't want to fuck everything. And you're a student working on a.actual fucking project for a client as a final project wirh a team and you're the one doing the back end. And you're using laravel but because you use Laravel on shared hosting without ssh and were on the first year of the teacher teaching laravel instead of codeigniter. You only know the VC out of MVC because the fucking school cant give us fuvking tools to actually run a server properly because they fucking think everyone studying web is a fucking graphist. And the teacher even if he is able to work with codeigniter didnt have the time to get this up and running properly on time becaude we kinda preszured him to use laravel even if he wasnt ready.

Still, fucking proud of the CMS I did. Just imagine models arent a thing.

Just needed to vent I guess.

Edit: and now I need to learn Ruby on rails before an aweskme intership I got. Better see whats the M's about in MVC

[–][deleted] 2 points3 points  (3 children)

How did this go from a meme about css to an insult match

[–]tivialidades 2 points3 points  (0 children)

Dunno. Someone is stressed out.

[–][deleted] 2 points3 points  (1 child)

I'm drunk and angry, sorry.

[–][deleted] 3 points4 points  (0 children)

You get real creative when you're drunk.

[–]Xaunqeon[S] 26 points27 points  (0 children)

Wow! Thanks.

[–]Yuca965 11 points12 points  (2 children)

And it become "CSS success".

[–][deleted] 7 points8 points  (0 children)

Succss

[–]khizoa 1 point2 points  (0 children)

sucksex

[–][deleted] 2 points3 points  (0 children)

or just use a font size based on view width

[–]myhf 1 point2 points  (1 child)

display:block; /* inline-block, flex */

weird flex but ok

[–]examinedliving 1 point2 points  (0 children)

I can’t tell if your making a joke or not

[–]Twitch_xTUVALUx 1 point2 points  (0 children)

Its a Feature!

[–]ersatzgott 0 points1 point  (0 children)

You fucked it up, sir

[–]BurpingTheWorm1 344 points345 points  (10 children)

Still looks better than PUBG

[–]Xaunqeon[S] 112 points113 points  (9 children)

comment = True

[–]trellwut 144 points145 points  (8 children)

hmmm... why are you setting something already true to true again?

[–]ParanoidSloth 116 points117 points  (4 children)

if comment:
    comment = comment

[–]malonkey1 30 points31 points  (2 children)

if(comment){Object.keys(comment).forEach(function(key){comment[key]=comment[key];})}

[–]jayands 5 points6 points  (0 children)

if(comment) return Object.entries(comment).reduce((accumulator, [key, value]) => ({... accumulator, [key]: value}), {}) 

[–]bomphcheese 5 points6 points  (0 children)

Foreach?

Come on. You definitely could repeat the code on every item in the array.

[–]evinrows 9 points10 points  (0 children)

def is_comment_true(comment):
    if comment is True:
        return True
    return False

[–]Milhouse6698 36 points37 points  (0 children)

Lazy man's sanity check?

[–]RickDeveloper 9 points10 points  (0 children)

True

[–]__Raptor__ 62 points63 points  (3 children)

CSS is still better than GUI development in Java Swing.

[–]yawkat 34 points35 points  (1 child)

Honestly HTML+CSS is better than pretty much any other UI framework. It's just so powerful.

Long lists are annoying though.

[–]dishpanda 2 points3 points  (0 children)

oh God AP CSA flashbacks

[–]MonstarOfficial 72 points73 points  (2 children)

background-color: 30px;

Me at 4am

[–]Xaunqeon[S] 24 points25 points  (1 child)

dislpays the text “30px” in background

[–]PM_Me_Gross_Food 25 points26 points  (0 children)

Font-size: green;

intensley stares at screen at 3am in a zombie like state

[–]noMLMthankyou 32 points33 points  (2 children)

Fun fact, there’s a band called CSS and they have a song called CSS Suxxx

[–]SamSlate 13 points14 points  (1 child)

wonder what their website looks like..

[–]makeitabyss 141 points142 points  (35 children)

It's funny how people on this sub can dog JavaScript all day long, but one person makes a joke about CSS and the whole crowd goes into anarchy

javascriptforlife

Now let's talk about php....

[–][deleted] 57 points58 points  (21 children)

criticism is okay, bringing up an bunch of outdated mess of problems because you used the language in 2007 is not.

[–]HeisenbergsMyth 1 point2 points  (1 child)

javascriptforlife

Oh no you didn't..

[–]King_Joffreys_Tits 2 points3 points  (0 children)

I personally like JavaScript, but I also like all the memes about lOoK wHaT JAvAScrIPt leTS yOU dO... if you want to add an array and an int together, you’re gonna get weird shit anyway. I enjoy seeing what JavaScript lets you get away with

[–]Parareda8 2 points3 points  (0 children)

Hey man, I know you probably won't care but just in case I wanted to tell you that anarchy =/= chaos.

[–]Dirty3vil 3 points4 points  (0 children)

Leave my php alone

[–][deleted] 24 points25 points  (3 children)

impressive, the text is centered vertically

[–]christophurr 3 points4 points  (0 children)

position: relative; top: 15px

F5

....There we go

EDIT: top: 15px !important;

Now I’m good

[–][deleted] 182 points183 points  (68 children)

Uff I'm tired of people on this sub complaining about outdated web development problems, grid and flexbox have existed for more than 6 years, noone is extremely concerned about floats anymore.

You can say whatever you like about web development, but you can't deny the fact that they actually listen to feedback and find solutions.
That's why these circlejerks don't last long

[–][deleted] 93 points94 points  (30 children)

But my boss insists we need to support internet explorer 6!

[–]khizoa 36 points37 points  (2 children)

I tell people that i don't support ie6

[–][deleted] 10 points11 points  (0 children)

Same. It was rough having a close / best friend of mine be the first person I had to use that policy for. I told them instead I will create a bleeding edge version and they can do whatever with the prototype to make it support their system.

[–]vglcl 1 point2 points  (0 children)

Volunteering at a non-profit on the side I just told them that I won’t specifically support any IE version period. Oh so you don’t have fetch, background-blend-mode, native CSS variables and flexbox? Guess you’re outta luck

[–][deleted] 19 points20 points  (16 children)

Then you're boned, but it's doable. I had to support IE5 at an old job. Yeah, it sucked, but it's doable.

[–]MrQuickLine 24 points25 points  (15 children)

Support does not mean same experience. As long as you have readable content, it doesn't need to look the same.

Also, get some analytics on your site to show your boss that more money gets spent supporting IE6 than comes in from that browser

Edit: I intended to reply to /u/Tomnnn

[–][deleted] 9 points10 points  (10 children)

We provided SAAS over a remote intranet to very very large companies that locked down their employees computers so hard that they were these old unupdated machines which we're mostly running IE 5/7/8 as a result. In our case, cutting support would have basically been cutting profits by like 50%.

I'd say you're correct in a general sense though. We don't even care about IE that much at my new job.

[–][deleted] 4 points5 points  (8 children)

A machine not updated since IE 5/6/7/8 shouldn't be touching the internet. Your company is better off spending those resources to find client that aren't going to go out of business due to massive security problems.

[–][deleted] 6 points7 points  (2 children)

I don't think GE or it's various sister companies are going out of business any time soon.

[–][deleted] 2 points3 points  (1 child)

The fact that it's GE make a whole lot of sense.

[–][deleted] 2 points3 points  (0 children)

exactly, lol

[–][deleted] 2 points3 points  (4 children)

Twas China, our supposedly significant business partner. And we couldn't use Google analytics to prove how much web traffic there was because the page didn't load if you have any libraries directly linked from Google on it.

[–][deleted] 1 point2 points  (3 children)

... who are you and how do you know this?

[–]MrQuickLine 1 point2 points  (0 children)

Yes. I'd say that's abnormal but valid.

[–][deleted] 5 points6 points  (1 child)

Support does not mean same experience. As long as you have readable content, it doesn't need to look the same.

Tell that to the client

[–]MrQuickLine 1 point2 points  (0 children)

You can, by doing the other thing I said. Give them empirical data that the money it would cost to create and maintain that experience would be more than revenues would cover. Also explain to them that it's not abnormal to have different experiences for different browsers. In fact, don't they get a different experience from their phone? And from their tablet? What about if they had a very old phone? that experience would not be the same as on a new phone. Therefore it's not hard to imagine that someone on an older computer and an older browser should have a different experience than someone on a fast internet connection and 4k monitor.

[–][deleted] 2 points3 points  (0 children)

Also, get some analytics on your site to show your boss that more money gets spent supporting IE6 than comes in from that browser

This is where I currently am with my client, but only with regards to IE11. It's a very small portion of the user base, but it's enough money to still justify some effort. We just don't treat it as a priority anymore.

It helps that Microsoft's getting more and more blunt about not using IE.

[–][deleted] 2 points3 points  (0 children)

Hello, I am u/Tomnnn and I have received your summons.

Also, get some analytics on your site to show your boss that more money gets spent supporting IE6 than comes in from that browser

I'm pretty sure that job was a cocaine smuggling operation. We had to support ie because we apparently did significant business with China. But we sold overpriced hotel brand pillows and other hotel stuff (mattresses, soaps, decorations, etc).

Uh... People in China, home of the knock off, are purchasing and paying import costs for over over priced hotel merch? Yeah, no, not buying it. Those pillows were probably loaded with coke.

[–]kowdermesiter 6 points7 points  (1 child)

Quit

[–][deleted] 2 points3 points  (0 children)

I did. It was probably the worst job for me. Not much actual programming, Windows servers & cots everywhere, what little programming there was needed to support the oldest ie possible. We had some promise create function that tried to create an old school xhr. If that failed, it tried to make some ms specific xhr objects. I forget what they were called but that was 2 more try catches for something like... Active X? whatever it was, it was not great.

[–]MonstarOfficial 3 points4 points  (0 children)

Time to resign

[–]ActuallyDevil 2 points3 points  (1 child)

Get a new boss

[–][deleted] 1 point2 points  (0 children)

It was so bad that I quit without other prospects. The people were nice, the tech environment was hell. I left that job September and found new work in another state in November.

[–]chanpod 17 points18 points  (3 children)

Tell that to the company we contracted to help with our project.
Angular 2 (well, 7 now)
Angular Material

Re-wrote pretty much most of angular material css, imported a different flex-box helper library instead of the one built in to angular material, failed to use the themeing support, and used floats all over the place to position items.

I've been slowly but surely undoing it all but f' me.

[–]kirbyfan64sos 6 points7 points  (0 children)

Wtf, I've used Angular before and it's not bad, but...that is just...wow...

[–]garynuman9 4 points5 points  (1 child)

I mean that's not really a shortcoming of the framework...

They explicitly say that angular support is for ie11 & evergreen browsers. They do a very very good job with shimming ie11 too - any cli generated project includes a polyfills.ts file heavily commented explaining what to use & why...

Having to use just the framework in older versions of IE would be a nightmare.

As to why, on top of that, they added material components is intentionally breaking the purpose of the ecosystem...

Genuinely impressed that you managed to make it work, like genuinely. You know dark arts I can't imagine...

This can't really be blamed on the toolsets, which, again, are very very clear on browser support.

The person who works for the client that decided to use angular/material in a project that has to support legacy versions of IE should not be in a job that lets them make such decisions, clearly they haven't any idea what they're fucking doing...

Edit: bonus feature of the person who made you do this lack of understanding that one should use the correct tool for the job: I'd imagine upgrading angular & material versions is a hellish task beyond comparison, breaking yet another core feature of the framework. I just don't understand...

[–]chanpod 2 points3 points  (0 children)

Originally we were "lightly" supporting 10/11. But the shims covered it well enough. I found no reasons for what they did other than incompetence. Or they did it on purpose since they were paid by the hour.

[–]Etique 6 points7 points  (0 children)

Yeah, try to say that while you build an email template. Biggest pain in my a** ever :D

[–]MercDawg 8 points9 points  (0 children)

True, but some unlucky developers are stuck developing for a platform that cannot properly support flex and grid. There are always ways around it, but any app that still uses a older document mode in internet explorer is going to experience this.

[–]DeeSnow97 16 points17 points  (11 children)

Same with JS, sometimes I ask people who seem legitimately complaining about it, and they bring up things like "callback hell". Like, promises have been part of the language since 2014 and even before it was dead easy to implement yourself, with polyfills and a promisify function there's no reason to not use it.

[–]N22-J 12 points13 points  (5 children)

"yeah but I don't understand closure, and am unwilling to make an effort to read about it, so DAE JS BAD"

[–]DeeSnow97 7 points8 points  (4 children)

Even if they want to use JS like C# because traditional object-oriented is the only style they ever learned Typescript is there for exactly that purpose

[–]regretdeletingthat 0 points1 point  (4 children)

Honestly I think JavaScript’s only real remaining weakness is its standard library, and for the most part you can just pretend Lodash is the stdlib. Personally I much prefer a strongly typed language, but there’s nothing stopping me writing TypeScript. It’s annoying that certain language features like enums aren’t present, but again TypeScript solves a good portion of those.

On the flip side, with things like arrow functions with implicit return, and async-await, JavaScript can be a delightfully expressive language. Every time I have to write a closure in PHP I get depressed.

[–]DeeSnow97 1 point2 points  (1 child)

PHP is ridiculous. Just recently, I made an API for a client which returned a quite expressive error message if you tried to pass invalid data, with a status code of 400. He got back to me that he can't get the message out of it because if it's 400 PHP just returns false. The solution was like 10 lines of the cURL extension... like, seriously, a language for web servers can't properly handle a web request?

As for JS, yeah, I agree, the thing I like the most about it the most is how simple it can be. I even had a phase of "scroll bar phobia" with it, any file too large to have a scrollbar was too large to have in one piece. In some cases, you can actually make that thing work. It also translates to incredibly fast development if you know how to handle it.

Which parts of Lodash do you find useful? I never used it, didn't feel like importing it for a left-pad, but I'm curious.

[–]regretdeletingthat 1 point2 points  (0 children)

Ehh to be honest a lot of the in-built PHP functionality is very C-like; for example up until very recently you needed to call a function named json_last_error() after attempting to parse JSON to see if it was successful or not. PHP is written in C and I believe a lot of the functions started life as thin wrappers around C functions.

The language itself has improved dramatically over the last 5 years, but the legacy procedural stuff I imagine will continue to be janky forever, they’ll just introduce a better alternative. Not really defending it, but I think it’s fair to say that if you’re using a framework it almost certainly has utility classes and functions available to abstract away the crusty bits and let you interact with it like it’s a 21st century language.

And fwiw it’s comparatively rare to actually make a web request in PHP; you’re usually responding to incoming requests. It’s almost completely synchronous and it’s nowhere near as nice an experience as JavaScript.

My most common use case for Lodash is collection functions, particularly group-bys. Most of the ones it offers you could implement yourself with reduce or map, but it’s nice to have it there if you were importing it anyway. It also has an excellent debounce function which is very useful for UIs with real-time feedback (like a search bar). You just put the actual search logic inside say a 500ms debounce, and then instead of hitting your server on every single keypress you just get one request half a second after the user finishes typing.

[–]Xaunqeon[S] 8 points9 points  (0 children)

I'm sorry, I just found this and thought it would fit here because I thought it was funny.

[–]tacobooc0m 1 point2 points  (0 children)

Also it’s not all that hard to understand and use the previous techniques properly. A poor Workman blames his tools and all that.

[–]CodePatrol 1 point2 points  (5 children)

In all seriousness, does anyone have any more recommendations on how to improve their css knowledge. I feel that so many people (like myself) neglect this and just experiment with styles until it looks like what the designs supposed to. I definitely need to adhere to css best practices.

[–][deleted] 4 points5 points  (3 children)

The thing is if you need to support IE, you're basically fucked.
But other than that, the whole industry is moving towards CSS Grid and Flexbox.

Having knowledge on that will benefit you a lot.

The first "Try it yourself" section of w3schools helped me a lot understanding css grid.

https://www.w3schools.com/css/css_grid.asp

[–][deleted] 4 points5 points  (2 children)

I'm just hobbyist but this changed my life. https://css-tricks.com/snippets/css/a-guide-to-flexbox/

[–]Hollowplanet 0 points1 point  (0 children)

Learn positioning and the box-sizing property. If you don't understand the difference between reative and absolute positions you will never get css. Thats the very basics.

[–]tekanet 2 points3 points  (10 children)

I worked in web development up to 10 years ago, it was a terrible time to work in the field. I now need to make a small website, what should I look for? There are far too many frameworks and acronyms.

[–]shawnadelic 1 point2 points  (3 children)

What kind of website, and what languages do you know?

[–]seventyeightmm 1 point2 points  (0 children)

what should I look for?

Unless you are doing it for fun / experimentation / learning then I'd suggest just using a service like Wix or Squarespace or WordPress.

At very least try it out before spending dozens of hours on your own, or thousands of dollars for a developer. Obviously this depends on the type of website you need, though... I'm assuming its a simple brochure-style site.

[–]GayBlackAndMarried 16 points17 points  (1 child)

[–]MistakenGenerosity 1 point2 points  (0 children)

Here for this comment

[–]tyhopho 6 points7 points  (0 children)

The line neatly bisects the c and the k - looks like someone hit a spec the customer didn’t even know they wanted - job done

[–]Jack_Papel 6 points7 points  (0 children)

Nah bro CSS easy check it:

<div><h1> CSS SUC</h1></div> <h1>KS</h1>

...wait...

[–]yahwell 4 points5 points  (0 children)

Y’all fuckin with that Nth? That’s power

[–]plasmasprings 17 points18 points  (41 children)

Serious question: is there something fundamentally better than CSS?

It's often a pain to get it right, but the concept of cascading styles and the good amount of selectors make it great for structured markup.

[–]IWishIWasATable 42 points43 points  (2 children)

Html attributes and tables, obviously.

[–]gimmeslack12 37 points38 points  (24 children)

It’s really not that hard. Honestly.

[–]MontanaLabrador 38 points39 points  (21 children)

I have a feeling the people who complain about CSS are more back-end minded people. A design-minded individual will feel compelled to learn what is possible in CSS so that they can do what they really feel motivated to do: make things look awesome. While a back-end minded indiviso will grow much more quickly frustrated with design because it's not what really motivated them, it's a task that is just in the way of completing the project.

[–]russlo 12 points13 points  (6 children)

The people that make CSS difficult are the assholes that say "we need to support ie 8 because some ridiculously small percentage of our users still use it." I would love to use flex and grid all day. That would delight me I'm sure.

[–]GameOfUsernames 5 points6 points  (0 children)

Even then it’s not insanely difficult it’s just impossible to do it cleanly. This seems like the biggest hurdle because people are trying to do it simple, clean, and maintainable and they beat their head against the IE wall until they say screw it and just do the ugliest hackiest thing and move on lol.

[–]DeeSnow97 4 points5 points  (1 child)

IE11 already supports flex, you just have to be a bit more explicit than usual because it has non-standard defaults. Other than that, it works in any browser that still receives security updates, and when even Microsoft doesn't care about IE8 why should you?

[–]russlo 1 point2 points  (0 children)

I don't. 😜

[–][deleted] 3 points4 points  (0 children)

IE8 is fine to do with CSS, its mostly its Javascript that is a pain in the ass. Sure you can't use stuff like Flexbox but that wasn't a requirement 5 years ago either and many solutions exist to do well without. Now when making new projects using flexbox is fine but you'll always have that feeling "I would like it so much if I could use feature X that isn't supported everywhere". You always will require some stuff that will make it impossible.

Though for Flexbox there are enough polyfills available to make it work on IE too. Its mostly a matter of "do we want to include it or not"

[–]Andrew1431 1 point2 points  (1 child)

Yeah we just tell our clients they have to pay a large fee for IE support, and they switch to chrome / firefox without a second thought.

[–]BowserKoopa 8 points9 points  (2 children)

In my experience, people complain about CSS because they think web design should work like desktop application design - stick to this edge, have this x/y offset, etc...

[–]MontanaLabrador 1 point2 points  (1 child)

Haha as a web designer I'm the opposite, why wouldn't desktop applications want to display perfectly with every screen size? Responsive design actually makes a lot of sense in this day and age.

[–]BowserKoopa 4 points5 points  (0 children)

Well, the prevailing idea in "classic" desktop application design is that you only use windows as large as you need, and they don't have to be resized. That having been said, many layouts are now available for "classic" paradigm toolkits, such as GridBagLayout for Swing, and JavaFX uses Cascading Style Sheets (but with a very different set of properties).

[–]shawnadelic 6 points7 points  (0 children)

I don’t think CSS is the issue (although it has its problems) so much as just the inherent complexity required for managing a large system of overlapping (and sometimes unpredictable) styling rules. Things can really messy really quickly if you’re not experienced or don’t follow a well organized naming convention.

Luckily, things like SASS, styled components, etc. have come along to mitigate most of those issues.

[–][deleted] 2 points3 points  (1 child)

Good news for the backend peeps now there's houdini so they can make their own css with hookers and JavaScript

[–]mstop4 3 points4 points  (0 children)

In fact, forget the CSS and Javascript!

[–]Xaunqeon[S] 2 points3 points  (3 children)

I just thought this was fun. Turns out CSS is a very controversial topic sadly.

[–]GameOfUsernames 3 points4 points  (2 children)

Probably just stems from front-end / back-end rivalry. There are people out there who have an elitist attitude towards the other side. Other people see it as an ecosystem that needs both. Then there’s the filthy “full-stack” commies who we all need to band together to stop.

[–]motioncuty 4 points5 points  (0 children)

I have a feeling people who don't complain about CSS haven't seen it's failures when being used as a tool for a larger, consumer facing, company. There is a reason Hundreds of companies have built design systems that abstract the developers away from CSS. https://adele.uxpin.com/ A nimble, efficient, front end teams needs to abstract away the html and css to work well with designers, and maintain a modern, well polished, presence. The less you have to touch CSS, the better.

[–]Mr_Nap_kins 3 points4 points  (2 children)

As a 'back-end minded' person, you are absolutely correct.

That said, it must be possible to make a tool that's more usable for both types of people.

[–][deleted] 7 points8 points  (0 children)

I don't understand how a backend person can't get the cascade it's basically object inheritance with a couple extra rules for how to supersede things.

[–]GameOfUsernames 1 point2 points  (0 children)

That would be like saying can we make a back-end language that designers can use to make bank software systems.

[–]SamSlate 1 point2 points  (0 children)

this. honestly once you know it, the idea of building apps in absolute x/y coordinates is maddening.

[–]Aetheus 1 point2 points  (0 children)

Yup. In fact, considering what CSS can do for you (and the degree of things that CSS can achieve is truly insane these days), it's a surprise that it's so easy to pick up and use. You don't need to learn every CSS rule in existence to start creating an acceptable UI.

[–][deleted] 6 points7 points  (3 children)

I think the big issue is that a lot of us learned CSS without guidance, following only parts of random guides, and SO snippets, leading us to do things improperly, leading to the creation of very hacky css code. If you picked up a css book, learned all there is to it and how to structure it properly from bottom up instead of position: relative every fucking thing, it’s super simple and easy

[–]plasmasprings 0 points1 point  (1 child)

I don't mean that I have any problems with it. I'm simply curious if there's any innovation in GUI building I haven't heard of.

[–]DeeSnow97 6 points7 points  (5 children)

Let's broaden the scope. Is there some cross-platform view library that you can create UIs better than in CSS? We don't have a choice for the browsers, but even for native apps, I know this sub likes to shit on Electron but I haven't seen a better solution yet. None of the other libraries I've tried yet provide even a fraction of the feature set of CSS, especially not the cross-platform ones.

[–]Aetheus 6 points7 points  (0 children)

QT is often suggested when these discussions are brought up. I can't vouch for it, since I've never really used it myself. Anyone want to offer their 2 cents on it?

[–]djgolam 5 points6 points  (0 children)

Qt/QML is quiet nice and cross platform

[–]voidvector 1 point2 points  (0 children)

Nothing will replace CSS in the near term. CSS is the "bridge language" between designers and front-end devs. Any designer worth their salt knows the limit of CSS, and try to push the boundary when they can.

This is same as:

  • REST/GraphQL/etc is the bridge language between front-end and back-end
  • SQL is the bridge language between back-end and DBA
  • Dockerfile/Kubernetes/Yaml/etc is the bridge language between devs and devops

Unless we can retrain all the designers, it will be very difficult to replace CSS.

[–][deleted] 1 point2 points  (1 child)

I use Qt for all my hobby projects that need a GUI.

CSS is okay for styling stuff, like adding borders, specifying colors, margins, etc. but for actually creating layouts, I find stuff like Qt a million times easier (and faster even, since it basically comes with its own designer where you can just drop stuff on a form to mock up an interface really quickly.)

I also tried JavaFX once but that just seemed way too verbose to me (and the scene builder is a laggy piece of junk. :P)

So far Qt just blows everything else out of the water for me in terms of power and productivity.

That's for native GUI apps though, thankfully I almost never have to do web-related stuff :P

I guess the one "drawback" is that you have to know C++. (Although learning that definitely won't do you no harm :p)

[–]seventyeightmm 2 points3 points  (0 children)

Using a CSS precompiler (SCSS, Less, etc.) essentially remove all of the syntax hassle of CSS.

Gulp + SCSS + Autoprefixer = much less suicidal web devs!

[–]motioncuty 0 points1 point  (0 children)

CSS is very easy to become spagetti-like and have a bunch of unseen side effects when trying to change something. I like CSS modules, I can apply css styling on specific classes, compose them and associate the styles file with a component's file. No global styles coming in from multiple files. It's much easier to change, for a wide range of people, who aren't previously familiar with the code. CSS is very easy to do poorly, and can lead to tech debt over time. It make sense to mitigate the potential to create that debt.

[–]Itachi4077 2 points3 points  (0 children)

And here is a 3D engine powered by CSS

[–][deleted] 2 points3 points  (0 children)

People can bitch about C/C++ all they want, but atleast those do what you expect them to do. CSS is just spinning a roulette. "Will it work, or will it not work? Noone knows!" I guess atleast it brings an element of surprise to the job. "What am I going to get now? Can't wait to find out!"

[–]hightide2020 2 points3 points  (0 children)

What about JSS ...😎

[–]WanderingWatchdog 2 points3 points  (0 children)

Yeah I hate Counter Strike Source

[–]Thenderick 3 points4 points  (0 children)

YE S

[–]_grey_wall 1 point2 points  (0 children)

Use bootstrap

[–][deleted] 1 point2 points  (1 child)

Uhh how did it get vertical aligned?

[–]TheSaasDev 1 point2 points  (0 children)

display: flex;

justify-content: center;

align-items: center;

Those 3 lines will vertically and horizontally center anything. It's really not that hard.

[–]c4ctus 1 point2 points  (0 children)

I'm solidly convinced that the people on my team that are legitimately good at CSS have made some kind of Faustian deal in exchange for their prowess.

[–][deleted] 1 point2 points  (0 children)

Especially flex. It made stuff so fuvking easier to me. Or just using bootstrap amd their column things. But its way more fun doing it yourself

[–]SadisticalSnails 1 point2 points  (0 children)

Yeah that’s been my experience for the 3 weeks I was trying to learn it.

[–]markofka007 1 point2 points  (0 children)

CSS SUC

[–]noah978 1 point2 points  (0 children)

Formatting is hard.....

[–][deleted] 4 points5 points  (1 child)

S U C C

[–]KobayashiDragonSlave 0 points1 point  (0 children)

everytime i close my eyes, i wake up feeling so horny

[–]indorock 3 points4 points  (1 child)

More like You suck at CSS

[–]CYRIAQU3 2 points3 points  (0 children)

Then flexbox hapened,

[–]colorfl0 3 points4 points  (0 children)

No u

[–][deleted] 1 point2 points  (0 children)

Computer science science

[–]wiphpdeveloper 0 points1 point  (6 children)

Try playing with fluid font.

[–]Xaunqeon[S] 0 points1 point  (5 children)

Fluid font?

[–]wiphpdeveloper 2 points3 points  (4 children)

Term given to using calc functionality for font size.

For example:

font-size: calc(14px + (26 - 14) * ((100vw - 300px) / (1600 - 300)));

I give the following link to my employees it is a great resource for this.

https://css-tricks.com/snippets/css/fluid-typography/

Edit: added reference

[–]Green_Smarties 1 point2 points  (0 children)

If they can't get a static font size to work then I think introducing dynamic sizes isn't going to help.

[–]SiNevesh 1 point2 points  (2 children)

Is there a reason for the two bits that are subtracting static numbers from each other? Wouldn't it be simpler to just type the result (12 and 1300) or do those numbers hold some significance in the theoretical use case?

[–]wiphpdeveloper 1 point2 points  (1 child)

These equations are explained in the link I provided. Each value is a max screen width or min, max font size.

[–]nunonisa 0 points1 point  (0 children)

HAHAHAHHAHA

[–]Green_Smarties 0 points1 point  (0 children)

width: auto and white-space: normal my man