Can I use CSS/style devtools for a React Native app? - css

I'm running a React Native app in the iPhone simulator on macOS and I've been able to get standalone react-devtools to work but I haven't found a way to get browser devtools style/CSS editing to work. It seems this app only provides access to the Components and Profiler tabs, which makes sense.
As stated in this related question, "when trying to [access styles and CSS editing devtools] using the react-devtools extension on the browser (Chrome, Safari, or Firefox) I only get access to the console, because all the components and elements are the ones displayed in the devtools web-page".
Is it possible to inspect and update styles of my React Native application running in an iPhone simulator?
(if this is possible with the Android emulator then I'm interested in a solution for that as well)

CSS inspecting and debugging is actually built-in to the standalone React Developer Tools and React Native Inspector, but it's not intuitive to find.
CSS styles are rendered below the normal React DevTools "props" panel for a component. So if you have a long prop list/devTools is in a small window, you may need to scroll down to see them.
Styles applied via a theme will not appear in the "style" panel, but rather under the style prop in the "props" panel.
Hopefully the screenshot will clarify a bit. Once you do find them, they're editable from the panel, just like in normal browser DevTools.
(I'm using the Android emulator, but in theory it should be the same for iOS.)

Related

Cross browser Testing

Due to Bootstrap upgrade, there has been lots of changes in the CSS in all pages of the web application that I'm working on. This application is also mobile optimized. So I have the task the checking the UI of all pages of our application accross most browsers - IE8,9,10,11 , chrome, firefox, ios and android devices(phone, 7 inch, 10 inch).
Right now, I'm opening the existing version(old bootstrap) and the updated version(New bootstrap) of my website in 2 tabs, and switch back and forth between them to find out any UI issues like alignment and color change and text size.
Is there a better way of doing this?
Yes there are somewhat solutions to it, which make cross-browser and multiple device testing easy. Some of them are:
Ghostlab: allows synchronized testing which means if you click or scroll in one browser it happens across all browsers. It has many other features but is only for Mac.
Grunt also allows for synchronized testing. Check this article
you can do cross browser testing within a browser using online services such as
Last thing I would mention is xip.io just check it out!!!
Chrome DevTools are awesome for this purpose. They allow you to override settings for different devices by Developer Tool>Settings>Overrides you can override following to emulate
User agents
Device metrics
Device orientation
Touch events
CSS media

Xpages Mobile CSS: iOS7

I have an Xpages app and I want to surface some pages from that app into my iPhone App. I want the Xpages pages to look like iOS7 so the users have the same experience in the app and don't know they are not in a native app.
IBM has not updated their mobile CSS yet.
But there is some CSS that goes a long way to fixing this:
http://redpilldevelopment.com/xpages-mobile-controls-ios7-theme/
I was able to make script library in my app and then I was able to get the CSS into a page, all using the instructions on the site.
What I don't get is how to make my app use the css theme? When I view the page on my iPhone some of the page is rendered like ios7, but much is not. Do I have to match up each individual element on the page to the class in the custom css?
It depends on your page I guess. Not every control has a "mobile renderer". DataView does for instance but viewPanel does not. So that could be why you're seeing it fine for some things but not others.
I believe in 9.01 with the latest extension pack it's easier to override the mobile them. It had been pretty difficult before. I think that's why your linked article mentions that the iOS7 theme can't be in the Head tag.
You might need to override styles for anything that doesn't look like iOS7.

Is there a way to customize Google Chrome's Developer Console?

I consistently run into the need to clean up css files and strip unused css elements. I am aware that google chrome has the capability to display all the unused css elements on a page but there are times (like a project I am working on right now) where the original designer left hundreds of unused elements within this file.
So, my question here is -- does anyone know of a way to customize the google chrome developer console to export a list of all used CSS elements. Or, is anyone aware of an existing google chrome plugin which provides this functionality?
I realize there is a firefox plugin which provides these capabilities but I would love to find a similar solution for google chrome.
Thanks
You have two ways customizing the Google Chrome Web Inspector:
Web Inspector Options
Chrome Extensions
http://code.google.com/chrome/extensions/experimental.devtools.console.html
http://code.google.com/chrome/extensions/experimental.devtools.audits.html
You could create an extension that does what you need.

css fix for chrome, and other web browsers

I am looking for a fix for styling a webpage that so that a webpage on google chrome, will look the same as it does on firefox, meaning, is there some syntax in css to make all of the web browsers look the same. does this exist (I would also like one for I.E., and any other web browser if it exists if it exists)
Google Chrome uses a different rendering engine than Internet Explorer/Firefox, so may display web pages differently. Apple Safari uses the same rendering engine as Google Chrome (WebKit) and should display pages the same way.
If your site isn't rendering properly in any browser, make sure your HTML and CSS are valid by testing them at http://validator.w3.org/.
If your site doesn't render properly in Google Chrome or Apple Safari, file a bug at webkit.org as described at http://webkit.org/quality/reporting.html.
If your site renders properly in Apple Safari but not in Google Chrome, please file a bug against Google Chrome at http://code.google.com/p/chromium/issues/list.
How can I test my website in Google Chrome?
There are several tools to help you test your website in Google Chrome:
Web Inspector
Right-click on any component on a web page to launch the web inspector. You'll be able to see the elements and resources associated with the component on which you clicked, including a hierarchy view of the DOM and a JavaScript console.
Task Manager
Select the Page menu icon, then Developer > Task Manager (or press Shift+Esc). The task manager shows all running Google Chrome processes, and the resources that they're using (memory, CPU, and network).
JavaScript Debugger
Select the Page menu icon, then Developer > Debug JavaScript. This launches a JavaScript debugger that can be used to attach to existing processes.
I found the Answer. Being that I am using drupal, there is a built in IE fix for the theme that I am using (fusion) that creates separate css files (ie7.css, ie8.css, etc). using these, I can adjust what I need for IE specifically.
Most layout problems with decent browsers are cause by invalid HTML, invalid CSS, or misunderstanding what a particular piece of CSS is actually supposed to do.
In general, when I see a difference between FF and Chrome, it is because Chrome is doing the proper thing and FF just happens to be rendering some invalid CSS fine. 99% of the time, I can fix the CSS and get FF and Chrome to render the same.
The remaining times, I typically browser sniff and use jQuery to fix the problem.

Full on-the-fly stylesheet editing in Chrome or Safari

I hate Firefox, I really do, but as a web developer I'm chained to it b/c of the robust set of tools that Firebug offers. Recently Chrome and Safari's inspection tools allowed users to edit full chunks structural code (in a very buggy manner), but you still can't edit full stylesheets. Usually when someone brings this up, Chrome and Safari developers say "BUT YOU CAN EDIT CSS," and that's true, to an extent. You can edit CSS property-by-property (which takes forever if you have a lot of changes) in both browsers, but there is no way to see the full computed stylesheet, make edits within it, and immediately see the results. To date, only a full install of Firebug on Firefox allows you to do this.
Has there been any momentum in either of the Chrome or Safari camps to build a plugin to match this unparalleled function? Cheap plugins that allow you to insert CSS into the page are not the answer. It's really simple:
Have a list with the current stylesheets that are being referenced
Choose the one you want to edit, and click an edit button
See all the code in the stylesheet
Make changes and see them reflected on the page immediately
Is it really that hard to build something that does this? I think it must be, b/c why else would the developer communities of two browsers completely ignore it? If there's something out there that now offers this capability, I'd love to hear it; otherwise, maybe someone will step up to the plate and develop it for either Chrome or Safari. It seems like the guys who developed the CSS Edit app would be all over this.
Thanks to you I found it!
The Live Stylesheets extension for Chrome is what you are looking for. Be sure to restart Chrome after installation to use it.
You can edit external stylesheets in Chrome DevTools, too (since Chrome 15 or so). Just double-click the stylesheet contents in the Resources panel (or click the "Edit" button below), edit, Ctrl-S to commit a new revision, Esc to cancel editing. And it updates your page as you type!
You can edit your CSS files directly on Chrome without relying on any extension.
Here is how: Edit CSS files on the fly using Chrome DevTools
A different way to access it:
right click the page, select inspect
on the DevTools, click on "Sources"
locate the css on the "Network" pane and click it
change the css and save it ( by pressing ctrl+s )

Resources