Mourning is allowed and/or mandatory but with conditions :
- The widow is obliged to mourn 4 months and 10 days
- If she's pregnant then, the mourn time will be during all the pregnancy time
- The woman whose one of her relatives died is allowed for 3 days of mourning
According to this hadith,
Zainab bint Abu Salamah (May Allah be pleased with them) said: I went to Umm Habibah (May Allah be pleased with her) the wife of the Prophet (PBUH), when her father Abu Sufyan bin Harb (May Allah be pleased with him) died. Umm Habibah (May Allah be pleased with her) sent for a yellow coloured perfume or something else like it, and she applied it to a slave-girl and then rubbed it on her own cheeks and said: "By Allah, I have no need for perfume, I heard the Messenger of Allah (PBUH) saying from the pulpit, 'It is not permissible for a woman who believes in Allah and the Last Day to mourn for the dead beyond three days, except for the death of her husband; in which case the period of mourning is of four months and ten days."' Zainab said: I then visited Zainab, daughter of Jahsh (May Allah be pleased with her) when her brother died; she sent for perfume and applied it and then said: "Beware! By Allah, I don't feel any need of perfume but I heard the Messenger of Allah (PBUH) saying from the pulpit, 'It is not permissible for a woman who believes in Allah and the Last Day to mourn the dead beyond three days except in case of her husband (for whom the period is) four months and ten days.
Al-Bukhari and Muslim
And in Another hadith,
Narrated Um 'Atiyya:
We were forbidden to mourn for more than three days for a dead person, except for a husband, for whom a wife should mourn for four months and ten days (while in the mourning period) we were not allowed to put kohl in our eyes, nor perfume our-selves, nor wear dyed clothes, except a garment of 'Asb (special clothes made in Yemen). But it was permissible for us that when one of us became clean from her menses and took a bath, she could use a piece of a certain kind of incense. And it was forbidden for us to follow funeral processions.
See this about
من أحكام العِدَّة والحِداد
More reading on the fatwa page in arabic
according to the 2nd link,
Hanafi's view that it is not allowed for the women to wear Black only if her husband dies. While the
Malikis said it is permissible excluding that the black is not something that is considered an adornment in her country/city