MUI v5 styled from '#mui/system' vs '#mui/material/styles' - material-ui

there are two ways to import the styled() function. The docs says that the only difference is the default theme that is used. Does anyone know the difference?

According to their docs
You can use the utility coming from the #mui/system package, or if you
are using #mui/material, you can import it from #mui/material/styles.
The difference is in the default theme that is used (if no theme is
available in the React context).
The default theme from #mui/system is very minimal. The default theme from #mui/material/styles is an enhanced version of the default theme from #mui/system that comes with a lot of ready to use predefined properties. If you are interested in a side by side comparison of the two have a look at the codesanbox I made.

Related

How to read values from theme css files in gtk3 after version 3.20

In gtk3, after version 3.20 is released, a lot of Widget specific properties have been deprecated and it is advised to read those values for the particular Widget from the css. For example, in following link, for GTKScale, the slider-width property has been depricated and it is advised to read the value from the css.
https://developer.gnome.org/gtk3/stable/GtkScale.html#GtkScale--s-slider-length
https://developer.gnome.org/gtk3/stable/GtkScrollbar.html#GtkScrollbar--s-min-slider-length
I have a project where we are reading a lot of these values from gtk3 for specific widget for specific state like slider-length for GtkScale, min-slider-length for GtkScrollbar and many more.
I want to know how do I read these values from the css as being suggested by the documentation. I was not able to find any example for this anywhere.
I have seen that it is possible to read the full css using gtk_css_provider_get_named and then getting string representation of this css_provider. But this returns the full css of the theme and I don't think I should be parsing the css myself as this could be error prone. There should be a way to get the a particular property for specific widget for specific state flags.
Use gtk_style_context_get_property() for this, with the name of the CSS property.

Should I use a common prefix for my custom widget in flutter?

I am new to flutter and I had a quick look at the style guide but I didn't find anything about a 'common prefix' for a custom widget.
I come from angular where all the components of a package have a common prefix, so it's easier to choose between a library component and the personalized version (e.g. 'dx-button' and 'app-dx-button' where 'app' is my common prefix). This is because Angular uses a prefix that is defined in the file config of the app and is automatically added to the creation of the new component.
Is there something similar for Flutter?
Should I follow this 'prefix' patter?
I don't think there is something similar in Flutter. My custom widgets are manually tagged like this: PROJECTINITIALS_NAMEOFTHECOMPONENT.
For example, my ExtendedFab is called QFExtendedFab and has all the kinds of features that I reuse throughout the app.

How can I use Material UI in Scala JS?

My team works with Scala.js and I wanna use Material-UI. But those two's code types look very different. Most of the examples in Material-UI seem to be based on regular Javascript.
I've tried to search about that, but the information is very limited, so I couldn't get any useful information. Is there anyone using Material-UI with Scala.js?
When using most JS libraries from Scala.js, you need what is called a "facade" -- a strongly-typed Scala wrapper that describes how to use the weakly-typed JavaScript library.
There appear to be several Material UI facades, but most of them look a bit half-baked. I'd guess that the most mature is the one in Chandu's scalajs-react-components project -- in general, Chandu has done more with React in Scala.js than most folks. The general top-level page for the project can be found here.

How do I theme links in VSCode?

I am building a VSCode theme.
Currently im trying to change the behaviour for links, but I can't find the right setting. In my current theme file, there is no statement in tokenColors that seems to change anything. There is also no fontStyle: "underline" or something similar, yet a link like http://www.google.com is underlined.
I looked at it with the built in developer inspector (Developer: Inspect TM Scopes), but it only says:
string.quoted.docstring.multi.python
source.python
Where does the underline setting come from? How do I change the format for links?
There are two types of underlined links:
Link parsed from grammars. These would have a foo.link.language type scope
Links detected by a link detector
For links in the grammar, you can theme the link scope as normal.
You cannot directly theme links that come from the link detector. The "editorLink.activeForeground" ui theme property lets you theme the link when it is active, but you cannot theme a non-active link if it does not have a grammar scope associated with it.
For python specifically, the grammar likely need to be updated to parse the links. This can be done either by modifying the grammar or with an injection grammar

How to create a theme for a GWT application?

I want to create a user selectable theme to a GWT application? How can I do It?
You can use CSS to build theme-system on top of GWT. There are DOM structures in GWT components that limit the options what can be themed, but in general CSS (and CSS3 these days) is very powerful and designed just for this kind of things.
Simply, you can put single theme in a single CSS file and provide users with an option to change the effective CSS file.
Here you can find discussion about creating such system: http://groups.google.com/group/google-web-toolkit/browse_thread/thread/f4b8f184c49b98f9