Custom Style EditorGUI

It seems that EditorGUI components behave strangely when using a custom GUI Skin. A field would show a blue selection that spans across the width of its window.

How can we create custom styles for Editor GUI components such as IntField, FloatField, Popup etc?

More info:

Say you have an EditorGUILayout.FloatField and a custom GUI.skin.textField. When using Unity’s built-in Dark skin along with my custom skin, the custom textField is loaded. However, when using Unity’s Light skin, the default textField is loaded.

What is the correct method of skinning Editor GUI controls?

My preferred method is to customize an existing type.

you can watch all existing types with the following code in a custom EditorWindow:

	foreach(GUIStyle style in GUI.skin.customStyles)
	{
		GUILayout.Button(style.name,style);
	}

If you have the name of the style you can create your starting style for customization like this:

GUIStyle style = "OL Title";

The solution is to use EditorGUIUtility.LookLikeControls() and directly manipulating the styles in EditorStyles.