Genesis 1 is literal even if it is written in poetic style.
Exodus 20:11
(11) For in six days the LORD made heaven and earth, the sea, and all that in them is, and rested the seventh day: wherefore the LORD blessed the sabbath day, and hallowed it.
Genesis 1 is literal. But Genesis 1 doesn't teach a 'six 24-hour day creation'.
And in regards to Exodus 20:11, this verse is just one of five in the Pentateuch that addresses the fourth commandment.
1. Exodus 20:8-11
(8) "Remember to keep the Sabbath day holy.
(9) Six days you are to labor and do all your work,
(10) but the seventh day is a Sabbath to the LORD your God. You are not to do any work, neither you, nor your son, nor your daughter, nor your male or female servant, nor your livestock, nor the alien who is within your gates,
(11) because the LORD made the heavens and the earth and the sea, and all that is in them, in six days, then he rested on the seventh day. Therefore, the LORD blessed the Sabbath day and made it holy.
2. Exodus 31:12-17
(12) The LORD told Moses,
(13) "You are to speak to the Israelis: 'You are to surely observe my Sabbaths because it's a sign between me and you from generation to generation, so you may know that I am the LORD who sanctifies you.
(14) You are to observe the Sabbath, because it's holy for you. Whoever profanes it shall surely die; indeed, whoever does work on it is to be cut off from among his people.
(15) Work may be done for six days, but the seventh day is a Sabbath of complete rest, holy to the LORD. Whoever does work on the Sabbath shall surely die.
(16) The Israelis shall keep the Sabbath to make the Sabbath observance a perpetual covenant from generation to generation.
(17) It is a sign forever between me and the Israelis, for in six days the LORD made the heavens and the earth, but on the seventh day he rested and was refreshed.'"
3. Exodus 35:1-3
(1) Moses assembled the entire congregation of the Israelis and told them, "These are the things that the LORD has commanded you to do:
(2) For six days work is to be done, but on the seventh day you are to have a holy day, a Sabbath of complete rest in dedication to the LORD. Anyone who does work on that day is to be executed.
(3) You are not to light a fire in any of your dwellings on the Sabbath."
4. Leviticus 23:1-3
(1) The LORD spoke to Moses,
(2) Tell the Israelis, "These are my feast times appointed by the LORD that you are to declare as sacred assemblies.
(3) Six days you may work, but the seventh day is a Sabbath of rest, a sacred assembly. You are not to do any work. It's a Sabbath to the LORD wherever you live.
5. Deuteronomy 5:12-15
(12) "Keep the Sabbath day holy, just as the LORD your God commanded.
(13) Six days you are to labor and do all your work,
(14) but the seventh day is a Sabbath for the LORD your God. You are not to do any work: neither you, your children, your male and female servants, your oxen and donkeys, all your livestock, as well as the foreigners who live among you, so that your male and female servants may rest as you do.
(15) Remember that you were a slave in the land of Egypt, but the LORD your God brought you out from there with great power and a show of force. Therefore the LORD your God has commanded you to observe the Sabbath day.
For three of these passages (Exodus 35:2; Leviticus 23:3; Deuteronomy 5:12-15), no connection at all is drawn between God's work week and humanity's. For the remaining two passages, the 'proof' would hold only if neither the word for 'day' nor the word for 'Sabbath' were ever used with reference to any time period other than 24 hours.
In all five passages, the Sabbath rest for humanity is referred to as "...
a Sabbath...", indicating that there may be more than one kind of Sabbath. Hebrew scholar Gleason Archer noted, "By no means does this [Exodus 20:9–11] demonstrate that 24-hour intervals were involved in the first six days, any more than the eight-day celebration of the Feast of Tabernacles proves that the wilderness wanderings under Moses occupied only eight days." - Gleason L. Archer, "A Response to the Trustworthiness of Scripture in Areas Relating to Natural Science", in Hermeneutics, Inerrancy, and the Bible.
Sometimes the Sabbath is a full year, as in Leviticus 25:4, where God commands a 12-month rest period for agricultural land. Sabbaths for God's physical creation appear to be related to the biological limits of His creatures. Thus, a 24-hour rest period every seven calendar days is appropriate for humans, while a 12-month rest period every seven years is best for agricultural fields. Since God is not subject to biological limits, His "rest" period can be of any duration He chooses. The reference to a Sabbath seems to be a reference to the pattern of one out of seven, not its precise duration as part of the creation days. Therefore, the creation days need not be interpreted, based on the Exodus 20 passage, as 24-hour periods.
The apostle Paul made a similar point. When some Christians tried to enforce a particular day as the Sabbath, he wrote that believers should honor a Sabbath, but with the freedom to consider any day of the week as a rest period.
Romans 14:5-6
(5) One person decides in favor of one day over another, while another person decides that all days are the same. Let each one be fully convinced in his own mind:
(6) The one who observes a special day, observes it to honor the Lord. The one who eats, eats to honor the Lord, since he gives thanks to God. And the one who does not eat, refrains from eating to honor the Lord; yet he, too, gives thanks to God.
Just as the high priests of Israel served at a sanctuary that is a copy and shadow of what is in heaven, so the days associated by the rotation of the earth may be copies and shadows of the days distinguished by God in the Genesis creation record. The human and the temporal are always copies and shadows of the divine and the eternal, not vice versa. The seven days of our calendar week follow God's established pattern. His "work week" gives us a human-like picture we can grasp.
This communication tool is common in the Bible. Scripture frequently speaks of God's hand, eyes, arm, even wings. The context in each case makes clear that these descriptions are not to be taken concretely. Rather, each word presents a picture to help us understand spiritual reality about God and His relationship to us. Such usage in no way negates these words truthfulness.
The difference is not simply one of a "literal" versus "figurative" interpretation. Literal interpretation, properly understood, is a method of interpretation that gives full weight to all aspects of a passage's context, including the immediate textual context, the literary genre of the passage, the way words were used in the culture, the historical setting and purpose of the text, and the broader theological context. The suggestion of a pattern here is not a gratuitously figurative or symbolic interpretation of God's creative week but rather a recognition of anthropomorphism commonly used elsewhere in Scripture to describe God and His relationship to creation, including His creatures. The analogy of our Sabbath to God's rest does not demand a creation week of seven 24-hour days. Age-long creation days fit the analogy equally well.