Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there any well-maintained Constraint Layout for the Web?

Context

I recently used CSS to do the layout of a modern website and I was appalled at how things that ought to be simple (such as centering) require hacks & tricks instead of intuitive and legible code. It is unfortunate for a technology so widely used, all the more since CSS had 25 years to improve.

I browsed for alternatives and found that Constraint Layouts (i.e. layout done by specifying equation-like constraints that components have to satisfy) are common in mobile development, but could only find Layx (http://www.layx.org/) for the Web: a promising but incomplete and unmaintained constraint layout engine.

Questions

  1. Are there any well-maintained Constraint Layout for the Web ?
  2. What are the drawbacks of Constraint Layouts & what would it take for them to become mainstream ?

About Layx

  • Centered Hello World with Layx

  • You can find more examples on their website (http://www.layx.org/)

like image 775
Tristan Avatar asked Jul 09 '20 12:07

Tristan


People also ask

When should we use constraint layout?

ConstraintLayout provides you the ability to completely design your UI with the drag and drop feature provided by the Android Studio design editor. It helps to improve the UI performance over other layouts. With the help of ConstraintLayout, we can control the group of widgets through a single line of code.

Is constraint layout necessary?

No it it's depends on your need, if you want to make complex layout and want to make them responsive then you can.

Should I use constraint layout or relative layout?

ConstraintLayout has flat view hierarchy unlike other layouts, so does a better performance than relative layout. Yes, this is the biggest advantage of Constraint Layout, the only single layout can handle your UI. Where in the Relative layout you needed multiple nested layouts (LinearLayout + RelativeLayout).

How do you fix missing constraints in constraint layout?

To automatically apply any missing constraints you can press the 'Infer Constraints' button at the top of the editor. The red warning sign should now have turned yellow because we have resolved the missing constraints error. Also, the TextView object should have blue arrows coming out of it when selected in the editor.


1 Answers

There is a Constraint Library for react, React Constraint Layout

like image 56
Neo Wakeup Avatar answered Nov 11 '22 15:11

Neo Wakeup