Is there a reason the F-22 and F-35 look very similar other than style, they look very different to F-16s so is there a conscious effort to make them look cool?
ymb1 is right - stealth and not styling determine the looks of both the F-22 and the F-35. But there is more to it.
Watch Lockheed test pilot Tom Morgenfeld talk about them in this video:
The juicy bits are at 37:15' and at 43:35' into the video. Concerning the F-22 he says: Northrop built the F-23 exactly to what the Air Force asked for, while Lockheed built what the Air Force secretly wanted. And that was another F-15, with similar manoeuvrability.
Concerning the F-35 he says Lockheed's goal was to build an aircraft which is at least as good as an F-18 around the ship. This means manoeuvrability to land on a carrier even from off-nominal conditions; very forgiving to fly. By using the F-22 baseline, this manoeuvrability could be ensured.
Now look at all three of them:
McDonnell-Douglas F-15 Eagle (picture source)
Lockheed-Martin F-22 Raptor (picture source)
Lockheed-Martin F-35 Lightning II (picture source)
The edgy—no pun intended—looks are an example of form following function. The F-22 and F-35 are stealth aircraft, the edges (flat surfaces, sharp angles) help deflect the enemy's radar so they remain undetected.
Modern stealth aircraft first became possible when Denys Overholser, a mathematician working for Lockheed Aircraft during the 1970s, adopted a mathematical model developed by Petr Ufimtsev, a Soviet scientist, to develop a computer program called Echo 1. Echo made it possible to predict the radar signature of an aircraft made with flat panels, called facets. In 1975, engineers at Lockheed Skunk Works found that an aircraft made with faceted surfaces could have a very low radar signature because the surfaces would radiate almost all of the radar energy away from the receiver.— Wikipedia
The F-16 is not stealth.
Both planes were the result of competitions, in both cases Lockheed won. The programs were the Advanced Tactical Fighter and the Joint Strike Fighter. Coming from the same company, it's cost effective to borrow design elements.
The F-35 resembles a smaller, single-engine sibling of the twin-engine Lockheed Martin F-22 Raptor and drew elements from it.— Wikipedia
Some TV documentaries mention the looks playing a part of winning both programs, but this can be very subjective.
Below are the competing planes that didn't make it, they too have sharp edges.