Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Gildiss
Aug 24, 2010

Grimey Drawer

prom candy posted:

Lots of greys is pretty common. I used to give my designer poo poo and call him "50 Shades of Grey." The product I work on now has 10 total from almost-black to #fff.

Ask your designer to put a style guide and colour palette together for you. Once you get that he'll probably want to use colours from there because it's less work than finding a new one.

I put it together from what he initially designed.

We also had a styleguide created by an artist which was bright and colorful and he basically rejected it and picked only 3 colors out of it and everything else went greyscale. The 3 colors are a dark navy blue. Slightly less dark blue. And a pink. The pink is not our CTA color.

This is an app with a user base of 99.9% women. This palette is a crime.

Adbot
ADBOT LOVES YOU

Anony Mouse
Jan 30, 2005

A name means nothing on the battlefield. After a week, no one has a name.
Lipstick Apathy

Gildiss posted:

I am working with a designer now who is basically fresh out of college and just drat his designs are painful.

I have listed up the color choices that we actully implemented and there are 5 different whites, 3 light greys and 3 dark greys. Those are just the ones the previous dev bothered to put in. In his zeplin designs there are twice as many slight variants to those that went ignored.

He also made a product list page that was sortable and filterable with 0 details other than the image product name and brand name. Goddamn. Also likes to make the filter options all jumbled up into as many items can visibly fit on a row not a set number or columns for ease of scanning over.

Wtf is with the aversion to any colors at all?

I am trying to give very polite suggestions on changes and links to articles about design and user experience etc but it is becoming harder and harder to not just blurt out 'Your color pallete sucks poo poo dude please add more color. This is less expressive than an excel sheet.'

Does your company have brand, design, or style guidelines?

Edit: just saw your other post. If there are existing guidelines then encourage him to stay within that system but explore the full space therein.

Assuming you're a frontend dev you are well within your rights to give design feedback. Good visual and UX design does not begin and end at the "designer's" fingertips. Framing your feedback constructively can definitely be a challenge though. The #1 thing that leaps to mind is to force him to back up every design choice with a reason. "Why did you pick this color palette?" "Why are you using five different whites instead of one or two?" "Why is there no color being used here?" "Why did you organize the filter options this way?" Ask lots of of "why" questions, it will either, ease your mind to know the rationale behind decisions, and/or force him to re-evaluate those decisions, and/or reveal that there wasn't any kind of thought put into it at all and he's just throwing poo poo at the wall to see what sticks. One of the most essential parts of design is careful, intentional decision making that you can back up with an explanation. Without that, you know nothing, Jon Snow.

Anony Mouse fucked around with this message at 06:40 on May 10, 2020

Vincent Valentine
Feb 28, 2006

Murdertime

A veteran designer at work told me new designers are being taught to avoid colors other than branding/logo colors. Apparently it helps with brand recognition, and avoids problems with ADA color concerns. Instead of colors, the focus is on usability rather than aesthetic. Brand Recognition Rules All was the big takeaway from that conversation, it was interesting though.

prom candy
Dec 16, 2005

Only I may dance

Gildiss posted:

I put it together from what he initially designed.

The key here is you make creation and maintenance of the style guide and and colour palette his job so that it becomes "his" style guide. Then when he does something that doesn't fit within it you say "hey can we just use (x component) from the style guide instead here" or "oh can you go back and add these new greys to the styleguide and pick some names for them?"

For me this has been a pretty successful approach for reining in designers who don't constrain themselves or already work within systems. A lot of the job in FE development if you're not lucky enough to work with a really good designer is helping your not as good designer become better so that they're less of a pain in the rear end to work with. Being on the same page with a really good designer is one of the most satisfying parts of this job for me though. I don't have the ability to design good interfaces but I love working with a designer to create something cool and useful.

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!

prom candy posted:

The key here is you make creation and maintenance of the style guide and and colour palette his job so that it becomes "his" style guide.
but this doesn't need to be in the style guide because it's *~special~*, it's a totally one off use case.

Gildiss
Aug 24, 2010

Grimey Drawer

prom candy posted:

The key here is you make creation and maintenance of the style guide and and colour palette his job so that it becomes "his" style guide. Then when he does something that doesn't fit within it you say "hey can we just use (x component) from the style guide instead here" or "oh can you go back and add these new greys to the styleguide and pick some names for them?"

Oh yeah I tried to schedule this sync up so we could define and setup the styleguide but now he is too busy making lovely designs so that is delayed until further notice! Agile!

dividertabs
Oct 1, 2004

Thank you; it's especially interesting to hear from someone with a background on both sides.

Obfuscation
Jan 1, 2008
Good luck to you, I know you believe in hell
Are there any simple and straightforward tools that convert markdown into static html files? Preferably node-based. This is for a personal toy project so I might as well reinvent the wheel here because I need a fairly limited feature set, but if there’s an existing solution I’d rather use that.

edit: I think I'll use PostHTML

Obfuscation fucked around with this message at 12:47 on May 25, 2020

smackfu
Jun 7, 2004

I wouldn’t be surprised if there were a dozen options.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

I've got a pretty small app but it does need routing. Roll my own? Just use react-router? Anything else I should consider?

The Fool
Oct 16, 2003


Thermopyle posted:

I've got a pretty small app but it does need routing. Roll my own? Just use react-router? Anything else I should consider?

I haven’t used it yet, but I’ve heard good things about Reach Router.

I guess it’s supposed to be a lighter-weight, accessibility-focused alternative.

Otherwise react-router is probably fine, trivially easy to setup simple routes.

RC Cola
Aug 1, 2011

Dovie'andi se tovya sagain
React Router is great and easy to use.

prom candy
Dec 16, 2005

Only I may dance
react router is good

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

To clarify: I've used react router a lot, I'm just wondering if maybe there's something newer or more focused on small apps or something.

IAmKale
Jun 7, 2007

やらないか

Fun Shoe

The Fool posted:

I haven’t used it yet, but I’ve heard good things about Reach Router.
As a former user of Reach Router, I loved how smooth it was compared to React Router at the time. That said, just over a year ago the React Training people announced that the Good Bits of Reach Router would be rolled into a future version of React Router:

https://reacttraining.com/blog/reach-react-router-future/

In fact, React Router v6 is now in alpha and will include a guide on migrating from Reach Router:

https://github.com/ReactTraining/react-router/blob/7d4a5c5ee5651fc7a796c6cec8b980de2695f5f5/docs/advanced-guides/migrating-reach-to-6.md

I'd say invest in React Router now (v5 has been smooth for me on a couple of projects at work) and keep an eye on the v6 release.

fsif
Jul 18, 2003

I believe the developer of both is merging the best of each library into just react router, but probably doesn't make a huge difference which one you choose for a small project.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Thermopyle posted:

To clarify: I've used react router a lot, I'm just wondering if maybe there's something newer or more focused on small apps or something.

If you are using Redux, use redux-first-router. Otherwise, Reach is great, but as noted above, is likely going away into a new React-Router.

I have never ever really liked React Router for various reasons.

marumaru
May 20, 2013



Lumpy posted:

I have never ever really liked React Router for various reasons.

i'd be curious to hear some. react router is so widely used that it feels like it's a standard now. i never really gave it much thought

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Inacio posted:

i'd be curious to hear some. react router is so widely used that it feels like it's a standard now. i never really gave it much thought

Most of these are from way back, I haven't used it in years, so they may be invalid now, but for a long time, it just wasn't very... "React-like". It was relatively simple to use, but handling URL params and state and so on was not congruent with how the rest of React worked. Then came the breaking changes to fix that, and the bloat, and so on, and thankfully by then I had found alternatives I much preferred. I also was just bummed at some non-code specific things about the project, but that's not unique to React Router, so I'll not say much about them other than when someone well-placed in a community makes A Thing™, that thing can become "the standard" and sometimes that's not great.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice
Double post topic change!

I volunteer with a non-profit who sadly found out that I am a computer-toucher. So now I have to ask this question: What is a sane / secure way of doing a site that has static pages and the ability to add new pages with attachments (meeting minutes) by non-me non super computer savvy people. I don't mind up-front work to set things up, but want to be as hands off as possible after that (lol, I know....) Is there some magic thing for Gatsby that allows other to create content? Wordpress is right out, FYI for a number of reasons (namely them saying "NOT WORDPRESS", which made me very happy) but I haven't done anything in that space in years.

barkbell
Apr 14, 2006

woof
Why are they against using WordPress? A CMS seems just about perfect.

Gatsby or 11ty would be good if you can teach the secretary to write Markdown syntax or another template language. Either create your own web form to input the data into (at this point why not use WordPress or Drupal), or set up the secretary's computer directory to automatically sync with the file server that your SSG is pulling content from. Or from Google Docs.

barkbell fucked around with this message at 15:07 on May 29, 2020

IAmKale
Jun 7, 2007

やらないか

Fun Shoe
Forestry.io or Netlify CMS (“headless cms” and/or “jamstack” are good search keywords) are all worth looking into. They enable the use of a WordPress-like editing experience to manage content, then trigger static site builds to get the content live.

Some of these even handle file uploads by committing the files directly into the repo.

The Fool
Oct 16, 2003


Gatsby + netlify would be my choice.

https://www.netlifycms.org/docs/gatsby/

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

barkbell posted:

Why are they against using WordPress? A CMS seems just about perfect.


Bad experiences getting hacked I do believe.

prom candy
Dec 16, 2005

Only I may dance
Gatsby plus some kind of headless CMS is the way to go

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself

Lumpy posted:

Double post topic change!

I volunteer with a non-profit who sadly found out that I am a computer-toucher. So now I have to ask this question: What is a sane / secure way of doing a site that has static pages and the ability to add new pages with attachments (meeting minutes) by non-me non super computer savvy people. I don't mind up-front work to set things up, but want to be as hands off as possible after that (lol, I know....) Is there some magic thing for Gatsby that allows other to create content? Wordpress is right out, FYI for a number of reasons (namely them saying "NOT WORDPRESS", which made me very happy) but I haven't done anything in that space in years.

Ghost is a nodejs CMS i used setting up for my in-law.

The control panel is dead simple. Doesn’t have as much functionality as Wordpress but does the job

huhu
Feb 24, 2006
Google is failing me - I've got a series of portfolio pages that I can navigate through with forwards/backwards buttons. If the given project in my portfolio has enough content to scroll, the scrollbar causes everything to shift slightly left causing an annoying shift left and ride as the scrollbar appears/disappears between projects. Is there a good method to fix this?

Anony Mouse
Jan 30, 2005

A name means nothing on the battlefield. After a week, no one has a name.
Lipstick Apathy

huhu posted:

Google is failing me - I've got a series of portfolio pages that I can navigate through with forwards/backwards buttons. If the given project in my portfolio has enough content to scroll, the scrollbar causes everything to shift slightly left causing an annoying shift left and ride as the scrollbar appears/disappears between projects. Is there a good method to fix this?
IIRC the easiest way is to give
code:
overflow-y: scroll;
to the body element. That will cause the scroll bar to always appear, even if there is not enough vertical content to scroll.

N.Z.'s Champion
Jun 8, 2003

Yam Slacker
Hey I made a code generator for React and Vue and Angular (etc)

https://springload.github.io/metacomponent/

It's an interactive REPL so you can type code and it show you the generated template, kinda like codepen.

The reason I made it is because I was making a pattern library for my government and every government department has different front-end tech, but they all wanted tooling in their language of choice, so I made this thing. it's up on npm too if you want a package.

uncle blog
Nov 18, 2012

I want to create a simple dialog box in React. I've seen a few different implementations of how to do it, so there's a few details where I'm unsure of the best practices.

My initial thought was to have a boolean in the containing object determinining if it would show or not ({showDialog && <Dialog />}), but I see MaterialUI passes the boolean to the dialog itself instead (<Dialog show={showDialog} />). Is there some benefit to this I'm not seeing?

Also, in interest of making it fairly responsive, this is my approach: The dialog needs an outer div that takes up the entire size of the viewport. This is dimmed and has overflow set to hidden to hinder scrolling. The dialog is a child element of this, with a max and min height and with to work on both large and small devices. This is centered by making the parent a flex object.

The dialog gets passed a string to display, and a callback function to call if the user clicks "Yes" (it's a confirm dialog).




Anything here you would do different?

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

uncle blog posted:

I want to create a simple dialog box in React. I've seen a few different implementations of how to do it, so there's a few details where I'm unsure of the best practices.

My initial thought was to have a boolean in the containing object determinining if it would show or not ({showDialog && <Dialog />}), but I see MaterialUI passes the boolean to the dialog itself instead (<Dialog show={showDialog} />). Is there some benefit to this I'm not seeing?

Also, in interest of making it fairly responsive, this is my approach: The dialog needs an outer div that takes up the entire size of the viewport. This is dimmed and has overflow set to hidden to hinder scrolling. The dialog is a child element of this, with a max and min height and with to work on both large and small devices. This is centered by making the parent a flex object.

The dialog gets passed a string to display, and a callback function to call if the user clicks "Yes" (it's a confirm dialog).




Anything here you would do different?

window.confirm("your message")

marumaru
May 20, 2013



Lumpy posted:

window.confirm("your message")

works on every browser, responsive, mature api, super fast and hardware accelerated rendering (when available) out of the box?
yes please!

uncle blog
Nov 18, 2012

But that’s... what I already have. Thought I’d make something a little spicier. 😐

Doom Mathematic
Sep 2, 2008
window.confirm("your message") blocks the entire application, and is limited to a single string.

Your approach sounds pretty reasonable so far. I assume you're doing this as an exercise. You're going to need a second button and/or an X for the user to click on to cancel - and maybe wire up the dimmed backdrop so clicking on it also causes cancellation. And a second callback for that scenario, of course.

A good step after this would be to think about accessibility. Can the whole thing be done using a keyboard alone? Where does focus jump to when the dialog opens? When you press Tab in the dialog? When the dialog closes? How about aria-labels? How about being able to press Enter to accept or Escape to cancel?

After that, a good edge case might be what happens if the string provided is insanely long.

marumaru
May 20, 2013



uncle blog posted:

But that’s... what I already have. Thought I’d make something a little spicier. 😐

if it's a user-facing (or even worse, it's for a client!) then yeah, you might want to make a modal.

jokes aside, your approach sounds solid. i wouldnt make the blackout div position the modal, though - i'd make the modal be position fixed.
i also tend to pass a closeFn that you can attach to the blackout div (so tapping outside the modal closes it, as expected) and to a close button on the modal.

quote:

I see MaterialUI passes the boolean to the dialog itself instead (<Dialog show={showDialog} />). Is there some benefit to this I'm not seeing?

if you do that you reduce/eliminate the need to have "code" in your "template".

Doom Mathematic posted:

Your approach sounds pretty reasonable so far. I assume you're doing this as an exercise. You're going to need a second button and/or an X for the user to click on to cancel - and maybe wire up the dimmed backdrop so clicking on it also causes cancellation. And a second callback for that scenario, of course.

A good step after this would be to think about accessibility. Can the whole thing be done using a keyboard alone? Where does focus jump to when the dialog opens? When you press Tab in the dialog? When the dialog closes? How about aria-labels? How about being able to press Enter to accept or Escape to cancel?

^^^ good stuff here also

prom candy
Dec 16, 2005

Only I may dance
If you pass isOpen and onClose as props then the modal is capable of delaying the close callback and animating itself out. If the containing component just unmounts it you can't animate the close.

I build all my modals on top of the react-modal package. I dunno if there's something better it's just the one I started using in 2015.

uncle blog
Nov 18, 2012

Thanks guys!

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!
I'm going to be working on a modal/dialog thing too, but in Angular.

Any way I should go about doing it? A lot of times it has forms that require a OK/Cancel kind of thing.
IDK if I make a component, that uses ng-content to make the content dynamic.. but then how would the ok/cancel work? Wouldn't it NOT be the last thing in the DOM make it difficult to block the user from interacting with everything else?
Should it be like a single component, that some service injects all of its content into? Then how would validation work?
I've tried researching, but al the results are like "here's how to make one with Angular Material" or "here's a basic one that doesn't have a form"

Volguus
Mar 3, 2009

The Merkinman posted:

I'm going to be working on a modal/dialog thing too, but in Angular.

Any way I should go about doing it? A lot of times it has forms that require a OK/Cancel kind of thing.
IDK if I make a component, that uses ng-content to make the content dynamic.. but then how would the ok/cancel work? Wouldn't it NOT be the last thing in the DOM make it difficult to block the user from interacting with everything else?
Should it be like a single component, that some service injects all of its content into? Then how would validation work?
I've tried researching, but al the results are like "here's how to make one with Angular Material" or "here's a basic one that doesn't have a form"

Are you looking for something like this? Or this?

Volguus fucked around with this message at 16:51 on Jun 16, 2020

Adbot
ADBOT LOVES YOU

spacebard
Jan 1, 2007

Football~

The Merkinman posted:

I'm going to be working on a modal/dialog thing too, but in Angular.

Any way I should go about doing it? A lot of times it has forms that require a OK/Cancel kind of thing.
IDK if I make a component, that uses ng-content to make the content dynamic.. but then how would the ok/cancel work? Wouldn't it NOT be the last thing in the DOM make it difficult to block the user from interacting with everything else?
Should it be like a single component, that some service injects all of its content into? Then how would validation work?
I've tried researching, but al the results are like "here's how to make one with Angular Material" or "here's a basic one that doesn't have a form"

If it's a confirmation modal, then I'd re-use it. If it's anything complex, then I make a new component for each form. But I'm using @ng-bootstrap/ng-bootstrap too so it's trivial to implement. Usually my dismiss/close returns some value so that my parent component can subscribe / pipe the result using from().pipe().subscribe();

If you need to do something like this yourself, you need a component resolver service using ComponentFactoryResolver to create the component instance. The resolver uses a ViewContainerRef passed to it by whatever the parent component.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply