Romanticism was an intellectual movement that developed among German thinkers during the time of the Napoleonic conquest of Europe (1799-1815), and it fed directly into the fostering of German nationalism. More specifically, J.G. Fichte, in drawing on the work of J.G. Herder, romanticized the notion of a German national spirit (volksgeist) that could unite the formerly disparate German states.
Romanticism was essentially a counterpoint to French Rationalism, which had similarly united the French people and formed the basis for Napoleon's French Empire. Fueled by the philosophy and art of Goethe, Schiller, Herder, Kant, Hegel and Beethoven, Romanticism was a direct attack on the French Rationalist principle of universal law that could be applied to everyone and every nation without exception.
Fichte put forward the Romantic notion of Germany's superior national spirit, paving the way for the nationalism that sought to compound and protect it from outside influences.
This nationalism manifested either as a conservative nostalgia and longing for the traditional lifestyles that preceded Napoleonic reforms, or as a more liberal embracing of the principle of self-government at the heart of the French Revolution. Nevertheless, both manifestations uniformly opposed Napoleonic rule.
The Romantic ideal of a specialist "volksgeist" or national spirit in Germany later spread to other countries in Europe as the basis for the development of their own unique brand of nationalism.