According to an analysis on Cliffs Notes of "Leaves of Grass" by Walt Whitman, the three main themes are a celebration of his own individuality, an appreciation of America and democracy, and an expression of universal themes, such as birth, death and resurrection. For Whitman, democracy encompassed both the equal rights before the law of political democracy and the virtue of the individual of spiritual democracy.
An introduction to Walt Whitman's preface to "Leaves of Grass" on the Poetry Foundation website points out that Whitman believed in the spiritual role of the poet, and that a poet should feel toward the universe as a lover toward the beloved. He also believed that the body and its desires were beautiful. America, in Whitman's viewpoint, was the epitome of the poetic ideal because of its mix of rich and poor and its diversity of races. According to Whitman, poets were able to take disparate parts and turn them into great themes.
Walt Whitman self-published the first edition of "Leaves of Grass" in 1855, but he spent the rest of his life revising it and adding to it. From a small volume of 12 poems, it eventually grew into a large tome of more than 400 poems. They are largely non-rhythmic, and do not follow standard rules of poetry for length of lines and meter. When "Leaves of Grass" was first published, Whitman was fired from his job, and the poetry was considered offensive. It is now considered a masterpiece of American literature.