Answer
Assalamu Alaykum Dear Sister,
Thank you so much for asking this important question.
It is indeed very important to have a sincere desire to find out what our Beloved Creator loves in order to follow it and earn His closeness, His love and His blessings in this life and the next.
It is true that Allah Almighty looks at our hearts. This, my sister, means that He looks at the sincerity in our hearts and the true piety while we do what He commanded us to do.
This does not mean at all that He doesn’t want us to do certain actions or follow His commands simply because He looks at the hearts. Rather, this means that while doing what He commanded, we also have to make sure that we have a clean and pure heart and that we don’t have arrogance or false pride or any of the heart diseases that ruin the fruits of our deeds.
Now ask yourself this question: if Allah doesn’t want us to dress in a certain way, then why did He command us to do so? Does it make sense that Allah would command us to do something and then expect us to ignore it and not do it at all? Of course not. By emphasizing on the heart, Allah is teaching us to focus on our sincerity and true devotion to Him and true piety and humility and love for the Creator and His creation.
The hadith of the Prophet (peace and blessings upon him) indicates that Allah Almighty looks at both the heart and the deeds of the created beings.
It was narrated that Abu Hurairah, who attributed it to the Prophet (peace be upon him), said:
“Allah does not look at your forms or your wealth, rather He looks at your deeds and your hearts.” [Muslim]
This basically reminds us that our forms and our wealth are aspects that Allah has gifted us with. He is The One who created us in certain forms and He is The One who gifted us with wealth. These are aspects that He gave us as a test. He wants to see how these aspects affected our hearts and our deeds. He is interested in testing how we deal with what He gifted us with.
So Allah doesn’t look at what He gave us, but He looks at what we do with what He gave us and the implications of that on our hearts.
Mind you that what Allah commands us to do has impact on our hearts. Everything that Allah enjoined upon us has deep spiritual fruits. The hijab for example has deep spiritual effects on the woman. It truly uncovers the utmost light and power that are in a woman’s heart. It is no wonder then that the hijab was mentioned in the chapter of the Quran called ‘The Light’.
Allah says what means:
{Tell the believing men to reduce [some] of their vision and guard their private parts. That is purer for them. Indeed, Allah is acquainted with what they do. And tell the believing women to reduce [some] of their vision and guard their private parts and not expose their adornment except that which [necessarily] appears thereof and to wrap [a portion of] their head-covers over their chests and not expose their adornment except to their husbands, their fathers, their husbands’ fathers, their sons, their husbands’ sons, their brothers, their brothers’ sons, their sisters’ sons, their women, that which their right hands possess, or those male attendants having no physical desire, or children who are not yet aware of the private aspects of women. And let them not stamp their feet to make known what they conceal of their adornment. And turn to Allah in repentance, all of you, O believers, that you might succeed.} (Quran 24: 30-31).
So the commands of Allah are given to both men and women to lower their gaze, dress and behave modestly because these actions have implications on accentuating and protecting the light in their hearts.
To read more on this specific point, please check our previous detailed answer on the subject here:
Why Are Women Ordered to Wear Hijab While Men Aren’t?
Now, remember that societies have different norms that change over time. What was completely unacceptable 50 years ago may now be so commonly practiced. Even things that were regarded as extreme or unlawful or indecent may now be common.
And so to protect our hearts and our conduct and our set of moral values, Allah descends His timeless instructions that allow the created being to live a healthy pure life wherever and whenever he/she may be. This is Divine Mercy and Divine Wisdom.
He- being the All-Knowing- gave us comprehensive guidelines for modesty that would allow us to be honored and protected and dignified.
Just like in certain banks or schools, etc.… they dictate certain dress codes, Allah also honored us with certain dress code to maintain while in public to preserve our modesty and help us build societies with peace and honor and dignity, not with exploitation or objectification of men or women’s bodies.
All of that has impacts on the purity of our hearts. And Allah is helping us reach a state of self-purification that result in having a healthy, sound, pure heart that sees and receives Divine Wisdom and Divine Light and reflect that to others.
So, neither disobeying Allah nor displaying arrogance while obeying Him help us reach the state of sound heart. That’s why Allah reminds us to always have balance of good hearts and good deeds, not hearts without deeds or deeds without hearts. Seek balance and consistency so that the inner purity reflects the outer purity. That’s the point.
Hope this helps answer your question a bit.
Salam and please keep in touch.