Ivan Cankar is considered one of four representatives of Slovenian modernism (in addition to Murn, Kette, and Župančič). In 1899, which is now considered the beginning of Slovenian modernism, Župančič's debut collection of poetry "Čaša opojnosti" (The Goblet of Inebriation) and Cankar's "Erotika" (Eroticism) were published. Cankar soon began to write fiction and plays. His sketches, stories, novellas, and, later, novels and plays were influenced by the Romantics, naturalism, decadence, symbolism, and impressionism, and also by expressionism. In 1899, Cankar published his first collection of narrative prose. Titled "Vinjete" (Vignettes), the work is distinguished by its personal and lyrical style, as well as its symbolism. Cankar was influenced by the great Russian realists, such as Nikolai Gogol, Leo Tolstoy, and above all Fyodor Dostoevsky. He also studied Ibsen's and Shakespeare's plays, and translated "Hamlet" (1899) and "Romeo and Juliet" (1904). Indeed, his first play, the social-family tragedy "Jakob Ruda" (1900), was written at the same time. Soon after his second return from Vienna, Cankar began to write his first satirical novel. Based on the lives of artists and entitled Tujci (Strangers), it was published in 1901 for the Slovene Society (Slovenska matica).
Soon afterwards, he composed a series of short stories that would later be collected in "Knjiga za lahkomiselne ljudi" (A Book for Thoughtless People, 1901) During the same year, Cankar also wrote the satirical comedy "Za narodov blagor" ("For the Wealth of the Nation"). Cankar developed the type of artistic and political satire we see first in the novel Strangers and in the play For the "Wealth of the Nation", as well as in many other social satires – in such stories and novellas as "Življenje in smrt Petra Novljana" ("The Life and Death of Peter Novljan", 1903), "Gospa Judit" ("Madame Judith", 1904), "V mesečini" ("In the Moonlight", 1905), "Hlapec Jernej in njegova pravica" ("The Bailiff Yerney and His Rights", 1907), "Aleš iz Razora" (Aleš from the Furrow, 1907), the novel "Martin Kačur" (1905), the essay "Bela krizantema" ("The White Chrysanthemum", 1910), the plays "Kralj na Betajnovi" ("The King of Betajnova", 1902), "Pohujšanje v dolini šentflorjanski" ("Scandal in St. Florian Valley", 1908), and "The Serfs" (1910). In these works, he exposes the hypocrisy and mendacity of "bourgeois morals" that are mostly concerned with appearance and that are symbolized by the St. Florian Valley. The individual in conflict with the values of the village, the worker, and the petit bourgeoisie are the dominant themes in Cankar's work, though his oeuvre also contains other socially critical ideas. Cankar's protagonists are often caricatures and exaggeratedly obscurantist, which is why many perceived him as a cultural pessimist and nihilist. Cankar defended himself against this charge in his book of essays "The White Chrysanthemum". Between the comedy "For the Wealth of the Nation" (1901) and the book-length polemic "Krpanova kobila" ("Krpan's Mare", 1907), Cankar wrote two novels: "On the Hill" (1902) and "Križ na gori" ("The Cross on the Mountain", 1904). Cankar's art achieved its peak during World War I, when he was imprisoned in the Ljubljana Castle as an enemy of the state. During "the years of horror 1914–1917," a period during which any loose and open word could mean death, Cankar penned "Images from Dreams", the last book to be published in his lifetime. In this collection of sketches, a work of veiled images that arises from vague dreams expressing his nation's pain and anger against tyranny, Cankar reached deep inside in order to settle accounts with himself and the world. Images from Dreams is the most poetic of Cankar's prose works.