Yes it's possible. The California state education system is very forgiving.
All of the credits from your CC will transfer as long as there is an articulation agreement between said CC and one or more CSU/UCs(check assist.org for info on that). As mentioned before, your CSU credits may have a little more trouble, but you should get the majority, particularly if you go to another CSU.
I'm planning on doing similarly. Important thing to note, however, is that if you start a CSU or UC GPA, you will retain that CSU or UC GPA if you return to the same system (ie, CSU-CC-CSU = same CSU GPA; UC-CC-UC = same UC GPA). Your CC GPA won't be added in or anything, but you will go back to working on top of whatever GPA you had before you left.