Using a different size for elements matching a :hover selector is how a lot of CSS gets this done.
The first result on Google (https://gist.github.com/olmstadfm/d6b4d37219e957d9cdcdb3ec88...) also seems to employ the :hover selector to accomplish hiding the tabs. I don't know how effective this particular script is, but it makes sense to use such a system.