Zellij (Arabic: الزليج, romanized: zillīj; also spelled zillij or zellige) is a style of mosaic tilework made from individually hand-chiseled tile pieces set into a plaster base. The pieces were typically of different colours and fitted together to form elaborate Islamic geometric motifs, such as radiating star patterns. This form of Islamic art is one of the main characteristics of architecture in the western Islamic world. It is found in the traditional architecture of Morocco, the architecture of Algeria, early Islamic sites in Tunisia, and in the historic monuments of al-Andalus (in the Iberian Peninsula). From the 14th century onwards, zellij became a standard decorative element along lower walls, in fountains and pools, and for the paving of floors. It is also found in modern buildings making use of traditional designs such as the Hassan II Mosque in Casablanca which adds a new color palette with traditional designs.
The word "zillīj" (زليج) is derived from the verb "zalaja" (زَلَجَ) meaning "to slide," in reference to the smooth, glazed surface of the tiles. The word "azulejo", a style of painted tile in Portugal and Spain of the same name, in Portuguese and Spanish derives from the word "zillīj".
Zellij fragments from al-Mansuriyya (Sabra) in Tunisia, possibly dating from either the mid-10th century Fatimid foundation or from the mid-11th Zirid occupation, suggest that the technique may have developed in the western Islamic world around this period. Georges Marçais argued that these fragments, along with similar decoration found at Mahdia, indicate that the technique likely originated in Ifriqiya and was subsequently exported further west.: 99, 335 It may have been inspired or derived from Byzantine mosaics and then adapted by Muslim craftsmen for faience tiles. By the 11th century, the zellij technique had reached a sophisticated level in the western Islamic world, as attested in the elaborate pavements found at Qal'at Bani Hammad in Algeria.
During the Almohad period, prominent bands of ceramic decoration in green and white were already features on the minarets of the Kutubiyya Mosque and the Kasbah Mosque of Marrakesh. Relatively simple in design, they may have reflected artistic influences from Sanhaja Berber culture.: 231 Jonathan Bloom cites the white and green glazed tiles on the minaret of the Kutubiyya Mosque, dating from the mid-12th century in the early Almohad period, as the earliest reliably-dated example of zellij in Morocco.: 26
The more complex zellij style that we know today became widespread during the first half of the 14th century under the Marinid, Nasrid, and Zayyanid dynastic periods in Morocco, Algeria, al-Andalus, and the wider Maghreb.: 335–336  Due to the significant cultural unity and relations between the al-Andalus and the western Maghreb, the forms of zellij under Marinid, Nasrid, and Zayyanid patronage are extremely similar.: 188–189 In Ifriqiya (Tunisia), under the Hafsid dynasty, zellij tiling largely fell out of style during this same period and was replaced by a preference for stone and marble paneling.: 486–487
Zellij tiling was most typically used to pave floors and to cover the lower walls inside buildings. On walls, geometric murals were often topped by an epigraphic frieze. Zellij was also used on the exterior of minarets and on the entrance portals of some mosques. Geometric motifs predominated, with patterns of increasing complexity being formed during this period. Less frequently, vegetal or floral arabesque motifs were also created. By this period, more colours were employed such as yellow (using iron oxides or chrome yellow), blues, and a dark brown manganese colour.: 336 This form of expression within the conceptual framework of Islamic art valued the creation of spatial decorations that avoided depictions of living things, consistent with taboos of aniconism in Islam on such depictions. This style of tile mosaic is evident in famous buildings of the period such as the Alhambra palaces of the Nasrids, the mosques of Tlemcen, and the Marinid madrasas of Fes, Meknes, and Salé.
Among the most exceptional surviving examples of Nasrid zellij art are the dadoes of the Mirador de Lindaraja and the Torre de la Cautiva in the Alhambra. Whereas Arabic epigraphy in tilework was usually painted on larger square tiles, these two examples contain very fine Arabic inscriptions in Naskhi script that are made from the assembly of coloured tile pieces cut in the form of the letters themselves and set into a white background. The tiles of the Torre de la Cautiva are further distinguished by the use of a purple colour which is unique in architectural zellij decoration. The dado of the Mirador of Lindaraja also contains a particularly advanced geometric composition with fine mosaic pieces below the level of the inscription.
In addition to zellij work further west, a somewhat distinctive style of zellij with brightly coloured pieces, often in floral patterns of palmettes and scrollwork, developed among the craftsmen of Tlemcen. The most important early example of this style was the decoration of the Tashfiniya Madrasa (no longer extant), founded by Abu Tashfin I (r. 1318–1337). This type subsequently appeared in later monuments of this era, mainly in Tlemcen (such as the Mosque of Abu Madyan) but also further afield in the Marinid madrasa of Chellah, suggesting that the same workshop of craftsmen may have been employed by the Marinids around this time.: 187, 195, 206 : 526  The archaeological museum of Tlemcen contains many remains of panels and fragments of zellij from various medieval monuments dating back to the Zayyanid dynasty.
In the 16th century most of North Africa came under Ottoman rule. In Algeria, the indigenous zellij style was mostly supplanted by small square tiles imported from Europe – especially from Italy, Spain, and Delft – and sometimes from Tunis. Some examples of more traditional mosaic tiles found in this late period may have continued to be produced in Tlemcen.: 449 In Tunisia, another style of tile decoration appeared during the 18th century and was produced locally, but it consisted of square panels of fixed size, painted with scenes and flowers, in a technique similar to Italian maiolica rather than to the earlier mosaic technique.: 487 
In Morocco, existing architectural styles were perpetuated with relatively few outside influences.: 243 Here, traditional zellij continued to be used after the 15th century and continues to be produced up to the present day.: 414–415 Under the Saadi dynasty in the 16th century and in subsequent centuries, the usage of zellij became even more ubiquitous within Morocco.: 415 Under the Saadis, the complexity of geometric patterns was increased for the decoration of the most luxurious buildings, such as the Badi Palace (now ruined).: 268 Some of the zellij compositions in the Saadian Tombs are among the best examples of this type in situ.: 194–200 : 415 In this example, craftsmen employed finer (thinner) mosaic pieces and the thin, linear pieces that form the strapwork are coloured whereas the larger pieces that form the "background" are white. This scheme reversed the colouring pattern generally seen in older zellij (where the ground was coloured and the linear strapwork was white).: 415 In later centuries, a simpler and more economic style of tile decoration also appeared in Morocco, consisting of square panels whose surfaces are cut to form simple motifs against a bare earth background. This type of tile is often seen on the spandrels of large gateways or portals.: 415
Red pigment was added in the 17th century. The old enamels with the natural colours were used until the beginning of the 20th century and the colours had probably not evolved much since the period of Marinids. The cities of Fes and Meknes in Morocco, remain the centers of this art.
Fez and Meknes in Morocco are still the production centers for zellīj tiles due to the Miocene grey clay of Fez. The clay from this region is primarily composed of kaolinite. For Fez and Meknes, the clay composition is 2–56% clay minerals, of which 3–29% is calcite. Meriam El Ouahabi states that:
From the other sites (Meknes, Fes, Salé and Safi), the clay mineral composition shows besides kaolinite the presence of illite, chlorite, smectite and traces of mixed layer illite/chlorite. Meknes clays belong to illitic clays, characterized by illite (54 – 61%), kaolinite (11 – 43%), smectite (8 – 12%) and chlorite (6 – 19%). Fes clays have a homogeneous composition with illite (40 – 48%). and kaolinite (18 – 28%) as the most abundant clay minerals. Chlorite (12 – 15%) and smectite (9 – 12%) are generally present as small quantities. Mixed layer illite/chlorite is present in trace amounts in all the examined Fes clay materials.
As the colour palette of the zellīj tiles increased over the centuries, it became possible to multiply the compositions ad infinitum. The most current form of the zellīj is a square. Other forms are possible: the octagon combined with a cabochon, a star, a cross, etc. It is then moulded with a thickness of approximately 2 centimetres. There are simple squares of 10 by 10 centimeters or with the corners cut to be combined with a coloured cabochon. To pave an area, bejmat, a paving stone of 15 by 5 centimetres approximately and 2 centimetres thick, can also be used.
An encyclopedia could not contain the full array of complex, often individually varied patterns and the individually shaped, hand-cut tesserae, or furmah, found in zillij work. Star-based patterns are identified by their number of points—'itnashari for 12, 'ishrini for 20, arba' wa 'ishrini for 24 and so on, but they are not necessarily named with exactitude. The so-called khamsini, for 50 points, and mi'ini, for 100, actually consist of 48 and 96 points respectively, because geometry requires that the number of points of any star in this sequence be divisible by six. (There are also sequences based on five and on eight.) Within a single star pattern, variations abound—by the mix of colors, the size of the furmah, and the complexity and size of interspacing elements such as strapping, braids, or "lanterns." And then there are all the non-star patterns— honeycombs, webs, steps and shoulders, and checkerboards. The Alhambra's interlocking zillij patterns were reportedly a source of inspiration for the tessellations of modern Dutch artist M.C. Escher.
Themes often employ Kufic script, as it fits well with the geometry of the mosaic tiles, and patterns often culminate centrally in the Rub El Hizb. The tessellations in the mosaics are currently of interest in academic research in the mathematics of art.
These studies require expertise not only in the fields of mathematics, art and art history, but also of computer science, computer modelling and software engineering, all used for the Hassan II Mosque.
Islamic decoration and craftsmanship had a significant influence on Western art when Venetian merchants brought goods of many types back to Italy from the 14th century onwards.
Zellīj making is considered an art in itself. The art is transmitted from generation to generation by maâlems (master craftsmen). A long training starts at childhood to implant the required skills. In 1993, the Moroccan government abolished the practice of teaching young children starting at ages 5 to 7, when the Convention on the Rights of the Child (CRC) was ratified. Now young people learn zellīj making at one of the 58 artisan schools in Morocco. However, the interest in learning the craft is dropping. As of 2018, at an artisan school in Fez with 400 enrolled students only 7 students learn how to make zellīj.
Zellij tiles are first fabricated in glazed squares, typically 10 cm per side, then cut by hand into a variety of pre-established shapes (usually memorized by rote learning) necessary to form the overall pattern.: 414 Although the exact patterns vary from case to case, the underlying principles have been constant for centuries and Moroccan craftsmen are still adept at making them today. The small shapes (cut according to a precise radius gauge), painted and enamel covered pieces are then assembled in a geometrical structure as in a puzzle to form the completed mosaic. The process has not varied for a millennium, though conception and design has started using new technologies such as data processing.