Я хотел бы отобразить CSS ниже, но у меня возникли проблемы с прохождением этого моего двойного массива.
Как мне получить доступ как к первому, так и ко второму массиву и создатьэлемент, равный приведенному ниже?
Проблема, с которой я сталкиваюсь, заключается в том, что я могу получить доступ к первой карте, но вторая карта, которая находится внутри первой в @debug, появляется как "встроенная" ..
@mixin generate-table-nth($page-name) {
@if $page-name == 'indicators-page' {
$table-list: (
table-contract-details: ('SHOPPING:', 'NOME FANTASIA (ATUAL):', 'CÓD. CONTRATO:', 'DATA ASSINATURA CONTRATO:', 'DATA INAUGURAÇÃO:', 'DATA INÍCIO CONTRATO:', 'DATA FIM CONTRATO:', 'PRAZO CONTRATO:', 'ATIVIDADE:'),
table-contract-rent: ('SHOPPING:', 'CÓD. CONTRATO:', 'NOME FANTASIA (ATUAL):', 'DATA INÍCIO ALUG. CONTRATUAL:', 'DATA FIM ALUG. CONTRATUAL:', 'ALUGUEL CONTRATUAL:', 'DATA RENEGOCIAÇÃO:'),
table-percent-rent: ('SHOPPING:', 'CÓD. CONTRATO:', 'NOME FANTASIA (ATUAL):', 'TIPO PRODUTO:', 'DATA INÍCIO ALUGUEL %:', 'DATA FIM ALUGUEL %:', 'VOLUME VENDA:', '% VENDA:', 'OBSERVAÇÃO:'),
table-minimum-rent-reduction: ('SHOPPING:', 'CÓD. CONTRATO:', 'NOME FANTASIA (ATUAL):', 'DATA INÍCIO:', 'DATA FIM:', 'VALOR:', 'TIPO REDUÇÃO:')
);
@each $table-key, $nth-key in $table-list {
$table-name: $table-key;
@debug $table-key;
/*&[data-element-name=#{$table-name}] {
&:nth-of-type(1):before { content: $nth-name };
}*/
}
}
}
Вывод должен быть таким:
&[data-element-name="table-contract-details"] {
tbody {
tr {
td {
&:nth-of-type(1):before { content: "SHOPPING:"; }
&:nth-of-type(2):before { content: "NOME FANTASIA (ATUAL):"; }
&:nth-of-type(3):before { content: "CÓD. CONTRATO:"; }
&:nth-of-type(4):before { content: "DATA ASSINATURA CONTRATO:"; }
&:nth-of-type(5):before { content: "DATA CADASTRO CONTRATO:"; }
&:nth-of-type(6):before { content: "DATA INAUGURAÇÃO:"; }
&:nth-of-type(7):before { content: "DATA INÍCIO CONTRATO:"; }
&:nth-of-type(8):before { content: "DATA FIM CONTRATO:"; }
&:nth-of-type(9):before { content: "PRAZO CONTRATO:"; }
&:nth-of-type(10):before { content: "ATIVIDADE:"; }
}
}
}
}
&[data-element-name="table-contract-rent"] {
tbody {
tr {
td {
&:nth-of-type(1):before { content: "SHOPPING:"; }
&:nth-of-type(2):before { content: "CÓD. CONTRATO:"; }
&:nth-of-type(3):before { content: "NOME FANTASIA (ATUAL):"; }
&:nth-of-type(4):before { content: "DATA INÍCIO ALUG. CONTRATUAL:"; }
&:nth-of-type(5):before { content: "DATA FIM ALUG. CONTRATUAL:"; }
&:nth-of-type(6):before { content: "ALUGUEL CONTRATUAL:"; }
&:nth-of-type(7):before { content: "DATA RENEGOCIAÇÃO:"; }
}
}
}
}
&[data-element-name="table-percent-rent"] {
tbody {
tr {
td {
&:nth-of-type(1):before { content: "SHOPPING:"; }
&:nth-of-type(2):before { content: "CÓD. CONTRATO:"; }
&:nth-of-type(3):before { content: "NOME FANTASIA (ATUAL):"; }
&:nth-of-type(4):before { content: "TIPO PRODUTO:"; }
&:nth-of-type(5):before { content: "DATA INÍCIO ALUGUEL %:"; }
&:nth-of-type(6):before { content: "DATA FIM ALUGUEL %:"; }
&:nth-of-type(7):before { content: "VOLUME VENDA:"; }
&:nth-of-type(8):before { content: "% VENDA:"; }
}
}
}
}
&[data-element-name="table-minimum-rent-reduction"] {
tbody {
tr {
td {
&:nth-of-type(1):before { content: "SHOPPING:"; }
&:nth-of-type(2):before { content: "CÓD. CONTRATO:"; }
&:nth-of-type(3):before { content: "NOME FANTASIA (ATUAL):"; }
&:nth-of-type(4):before { content: "DATA INÍCIO:"; }
&:nth-of-type(5):before { content: "DATA FIM:"; }
&:nth-of-type(6):before { content: "VALOR:"; }
&:nth-of-type(7):before { content: "TIPO REDUÇÃO:"; }
&:nth-of-type(8):before { content: "OBSERVAÇÃO:"; }
}
}
}