This repository has been archived on 2025-01-19. You can view files and clone it, but cannot push or open issues or pull requests.
drupalcampbristol/web/modules/contrib/webform/css/webform.element.likert.css

126 lines
2.4 KiB
CSS
Raw Normal View History

2017-03-16 15:29:07 +00:00
/**
* @file
* Likert element styles.
*
* @see /webform/test_element_likert
*/
/**
* Answer column widths.
*/
[data-likert-answers-count="2"] th {
width: 30%;
}
[data-likert-answers-count="3"] th {
width: 20%;
}
[data-likert-answers-count="4"] th {
width: 15%;
}
[data-likert-answers-count="5"] th {
width: 12%;
}
[data-likert-answers-count="6"] th {
width: 10%;
}
[data-likert-answers-count="7"] th {
width: 8.57%;
}
[data-likert-answers-count="8"] th {
width: 7.5%;
}
[data-likert-answers-count="9"] th {
width: 6.66%;
}
[data-likert-answers-count="10"] th {
width: 6%;
}
/**
* Basic table formatting.
*/
2018-11-23 12:29:20 +00:00
.webform-likert-table-wrapper th,
.webform-likert-table-wrapper td {
2017-03-16 15:29:07 +00:00
text-align: center;
}
2018-11-23 12:29:20 +00:00
.webform-likert-table-wrapper th:first-child,
.webform-likert-table-wrapper td:first-child {
2017-03-16 15:29:07 +00:00
text-align: inherit;
width: 40%;
}
2018-11-23 12:29:20 +00:00
.webform-likert-table-wrapper td:first-child label {
2017-03-16 15:29:07 +00:00
display: block;
}
/**
2018-11-23 12:29:20 +00:00
* Mobile support to likert webform element that converts radios in table
* grid to inline vertical radios.
2017-03-16 15:29:07 +00:00
*/
@media (max-width: 768px) {
2018-11-23 12:29:20 +00:00
.form-type-webform-likert table.sticky-header {
display: none;
}
2017-03-16 15:29:07 +00:00
.form-type-webform-likert table {
border-collapse: collapse;
font-size: inherit;
}
.form-type-webform-likert thead {
display: none;
}
.form-type-webform-likert tr,
.form-type-webform-likert tr.odd {
border: 0;
background: transparent;
}
.form-type-webform-likert td {
display: block;
border: 0;
background: transparent;
padding: 0;
text-align: inherit;
}
.webform-likert-table[data-likert-answers-count] th,
.webform-likert-table[data-likert-answers-count] th:first-child,
.webform-likert-table td,
.webform-likert-table td:first-child {
width: 100%;
}
2018-11-23 12:29:20 +00:00
/**
* Show visually hidden radio title and description
* when Likert is displayed inline on mobile.
* @see \Drupal\webform\Element\WebformLikert::processWebformLikert
* @see core/modules/system/css/components/hidden.module.css
*/
.webform-likert-table .visually-hidden {
position: inherit !important;
clip: inherit;
overflow: inherit;
height: inherit;
width: inherit;
}
.webform-likert-label.visually-hidden {
display: inline;
}
.webform-likert-description.hidden {
display: block;
}
.webform-likert-help.hidden {
2017-03-16 15:29:07 +00:00
display: inline;
}
.form-type-webform-likert td:last-child {
margin-bottom: 1em;
}
}