authgear / authgear-server

Open source alternative to Auth0 / Firebase Auth
https://www.authgear.com
Apache License 2.0
82 stars 37 forks source link

UI v2 coding guidelines #3626

Open louischan-oursky opened 10 months ago

louischan-oursky commented 10 months ago

We have 2 levels of theming.

We borrow BEM naming convention to name the CSS variables.

Prefer tablet: over @media

HTML semantics is important.

Use gap for spacing.

See https://github.com/authgear/authgear-server/pull/3613#discussion_r1452897671

Use ltr: and rtl: when you use explicit left/right.

See https://github.com/authgear/authgear-server/pull/4662#discussion_r1735509674

Verbs

Always think about when the case when javascript is disabled

panic with error

Instead of panic("some string"), panic(fmt.Errorf("some string")). The rationale is that when you are the person who recover(), you want to get an error instead of a string. You can further call errors.As and errors.Is or any other errors processing functions on the recovered error.

louischan-oursky commented 10 months ago

Follow up issues

louischan-oursky commented 10 months ago

@tung2744 @IniZio @Ngkaokis Added Point 11.

louischan-oursky commented 9 months ago

Added Point 12.

fungc-io commented 8 months ago

@louischan is this documented? can I close it?

louischan-oursky commented 8 months ago

Let me close this. We can refer to this issue when we need it in the future.

rickmak commented 2 months ago

We should move the agreed content to CONTRIBUTING.md.