Override Material UI CssBaseline on a per-page basis (specifically the background color) - material-ui

I'm using the ThemeProvider and CssBaseline in my _app.js file. It's pulling in the background color from the theme as expected.
However, on some pages, I want to override the the body background color. I was able to achieve this by wrapping my page components in a different theme and adding CssBaseline as a child but it doesn't seem like the right way to do it since I'm already using CssBaseline at the app level.
Is there a better way to do this or am I on the right path?

I think your question is a little tricky but in css file use !important to overwrite the theme or frameworks file or use inline css

Related

MUI Material UI Styling Text

I just switched to using MUI Material UI, and this is a question about best practices.
How do I get standard MUI styled text throughout my application? Do I need to use Typography everywhere? What about text that I directly render within divs in my components? What about raw header elements?
I guess this also applies to rendering of raw elements like <a>, for example when I use Nav Links from bootstrap (I'm also using react-bootstrap for some components it provides). Is there a way to get the default MUI typography for that?
I know this is a pretty basic question, just want to wrap my head around the best practices when using this library. Thanks!

summernote is there a way to setup "background-image" for an element?

I come around to setup an background-image for summernote wysiwyg editor, let me know is there any control I need to set or any wysiwyg editor supports this thanks.
Summernote does not explicitly support setting background images in the editor. You should, however, be able to do so by setting the background in css on the .note-editable class, just make sure to do so after Summernotes declaration, i.e. include your style after the Summernote stylesheet. Keep in mind using backgrounds could make the visual appearance of elements inside the editing area harder to visualise.

Filepicker.io Web - Disable Inline Styles

I am having some trouble styling filepicker.io widgets for web, specifically filepicker-dragdrop.
Is there any way to disable the inline styling and replace them with classes?
Something like data-fp-disable-styles or perhaps when using data-fp-dropzone-class="..." the inline styling is automatically disabled.
Although you can add classes to the button with the attribute data-fp-button-class, I cannot get rid of the inline styling on the on the dropzone and container div.
You can set the data-fp-drag-class and data-fp-class options to set the styling of the dropzone and container div and use the !important flag for any styles that you want to use to override the inline styles.
If you're looking for a more fully customizable solution, we'd recommend using the raw javascript api's to create your own drag pane (https://developers.filepicker.io/docs/web/#widgets-droppane) and/or pick button

How to apply proper CSS with GWT components?

I have a gwt application which I need to apply custom themes for specific widgets, so I can maintain the Standard gwt CSS (for other widgets that I don't need to apply css to) in the gwt.xml file :
<inherits name='com.google.gwt.user.theme.standard.Standard'/>
I am using ClientBundle and CssResource approach in my app. I have applied simple css however I need to make a css that will be able to apply css for: selected and not selected, hover and push events/actions on a widget, just like what the standard gwt css provides.
What to write in the my css file so that for a MenuBar when I apply this:
ManuBar menuBar = new MenuBar(false);
menuBar.setStyleName(AppResources.INSTANCE.css().menuBar())
I will get the same MenuBar effects of a standard MenuBar css of gwt? With the App.css I have below, I just get a black menubar and the font-color of the menubar does not change, I think there is a proper way to apply css with gwt widgets, however I cannot find a good resource about this on the web. What I am trying to accomplish is to be able to change the menubar color theme to say, black, chrome or whatever color but still make the widget look like a real menubar.
App.css:
.menuBar {
background:#3c3b37;
font-weight:bold;
color:#FFFFFF;
font-size:10px;
}
I have a feeling you might be experiencing the problem lots of us face when we forget to call ensureInjected on the CssResource. The CSS never gets added to the page, and so it looks like it's not working.
AppResources.INSTANCE.css().ensureInjected();
why not try simply with menuBar.setStyleName("menuBar"); I'm sure this will work.

How to change the colors of HTML form elements displayed in UIWebView?

I have an application that opens HTML pages in a UIWebView. The pages have a specific color theme, which is disrupted by form elements on the page (I have few "select" fields), which have their own color theme (white font, light gray background). CSS can't seem to force it to display in other colors.
Does anyone know how to fix that?
Thanks!
Try using -webkit-appearance: none; to disable the browser's default styling, then apply your own styles. More info and examples at 37signals.
Try using !important in your external CSS styles. It could be that the style sheets for UIWebView are inline and are overriding your external styles.
For example, select { color:#000!important; } should override any inline style text color (unless it is set to !important as well) on <select> elements.