Стиль ввода флажка IE / Edge (Chrome / Firefox OK) - PullRequest
0 голосов
/ 04 августа 2020

(Kendo Checkboxed имеет класс k-checkbox)

Goal: Реплицировать стиль флажка Kendo для обычных флажков (без класса) с помощью: not (.k-checkbox)

Мой подход работает в Chrome / Firefox, но не в IE / Edge. Все классы (в Инспекторе) выглядят одинаково, но флажок не "синий", не могу понять почему.

Посмотрите Chrome / Firefox:

enter image description here

.

.

.

Look in IE / Edge:

image

/* Lookie loo for Kendo Check and Radio Boxes */

input[type=checkbox]:not(.k-checkbox) { /* 17353 common */
    margin: 0;
    padding: 0;
    width: 16px;
    height: 16px;
    line-height: initial;
    border-width: 1px;
    border-style: solid;
    outline: 0;
    box-sizing: border-box;
    display: inline-block;
    vertical-align: middle;
    position: relative;
    -webkit-appearance: none;
}

input[type=checkbox]:not(.k-checkbox)::before { /* 17369 com */
    content: "\e118";
    width: 12px;
    height: 12px;
    font-size: 12px;
    font-family: WebComponentsIcons,monospace;
    -webkit-transform: scale(0) translate(-50%,-50%);
    -ms-transform: scale(0) translate(-50%,-50%);
    transform: scale(0) translate(-50%,-50%);
    overflow: hidden;
    position: absolute;
    top: 50%;
    left: 50%;
}

input[type=checkbox]:not(.k-checkbox):hover { /* 17384 com */
    cursor: pointer;
}

input[type=checkbox]:not(.k-checkbox):checked::before { /* 17388 com */
    -webkit-transform: scale(1) translate(-50%,-50%);
    -ms-transform: scale(1) translate(-50%,-50%);
    transform: scale(1) translate(-50%,-50%);
}

input[type=checkbox]:not(.k-checkbox) + label:not(.k-checkbox-label) { /* 17411 com */
    margin: 0;
    padding: 0;
    line-height: 17px;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -ms-flex-align: start;
    align-items: flex-start;
    vertical-align: middle;
    position: relative;
    cursor: pointer;
}

input[type=checkbox]:not(.k-checkbox) + label:not(.k-checkbox-label) { /* 17436 com */
    margin-left: 4px;
}

input[type=radio]:not(.k-radio) { /* 17468 com */
    margin: 0;
    padding: 0;
    width: 16px;
    height: 16px;
    border-width: 1px;
    border-style: solid;
    outline: 0;
    box-sizing: border-box;
    display: inline-block;
    vertical-align: middle;
    position: relative;
    -webkit-appearance: none;
}

input[type=radio]:not(.k-radio)::before { /* 17483 com */
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
    -webkit-transform: scale(0) translate(-50%,-50%);
    -ms-transform: scale(0) translate(-50%,-50%);
    transform: scale(0) translate(-50%,-50%);
    overflow: hidden;
    position: absolute;
    top: 50%;
    left: 50%;
}

input[type=radio]:not(.k-radio):hover { /* 17498 com */
    cursor: pointer;
}

input[type=radio]:not(.k-radio):checked::before { /* 17502 com */
    -webkit-transform: scale(1) translate(-50%,-50%);
    -ms-transform: scale(1) translate(-50%,-50%);
    transform: scale(1) translate(-50%,-50%);
}

input[type=radio]:not(.k-radio):disabled,
input[type=radio]:not(.k-radio):disabled + label:not(.k-radio-label):disabled { /* 17508com */
    opacity: .6;
    -webkit-filter: grayscale(.8);
    filter: grayscale(.8);
    cursor: default
}

input[type=radio]:not(.k-radio) + label:not(.k-radio-label) { /* 17515 com */
    margin: 0;
    padding: 0;
    line-height: 17px;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -ms-flex-align: start;
    align-items: flex-start;
    vertical-align: middle;
    position: relative;
    cursor: pointer;
}

input[type=radio]:not(.k-radio) + label:not(.k-radio-label) { /* 17536 com */
    margin-left: 4px;
}

input[type=checkbox]:not(.k-checkbox){ /* 1204 boo */
    border-radius: 4px;
    border-color: #ccc;
    color: #333;
    background-color: #fff;
}

input[type=checkbox]:not(.k-checkbox):checked::before { /* 1211 boo */
    border-radius: 4px;
}

input[type=checkbox]:not(.k-checkbox):hover { /* 1219 boo */
    border-color: #aeaeae;
    color: #428bca;
    background-color: #fff;
}

input[type=checkbox]:not(.k-checkbox):focus { /* 1225 boo */
    box-shadow: 0 0 0 2px rgba(0,0,0,.06);
    border-color: #aeaeae;
}

input[type=checkbox]:not(.k-checkbox):checked { /* 1236 boo */
    border-color: #428bca;
    color: #fff;
    background-color: #428bca;
}

input[type=checkbox]:not(.k-checkbox):checked:focus { /* 1242 boo */
    box-shadow: 0 0 0 2px rgba(66,139,202,.3);
    border-color: #428bca;
}

input[type=radio]:not(.k-radio){ /* 1247 boo */
    border-color: #ccc;
    color: #333;
    background-color: #fff;
    border-radius: 50%;
}

input[type=radio]:not(.k-radio):checked::before { /* 1254 boo */
    border-radius: 50%;
}

input[type=radio]:not(.k-radio):hover { /* 1258 boo */
    border-color: #aeaeae;
    color: #428bca;
    background-color: #fff;
}

input[type=radio]:not(.k-radio):focus { /* 1264 boo */
    box-shadow: 0 0 0 2px rgba(0,0,0,.06);
    border-color: #aeaeae;
}

input[type=radio]:not(.k-radio):checked { /* 1269 boo */
    border-color: #428bca;
    color: #fff;
    background-color: #428bca;
}

input[type=radio]:not(.k-radio):checked:focus { /* 1275 boo */
    box-shadow: 0 0 0 2px rgba(66,139,202,.3);
    border-color: #428bca;
}
 <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2020.1.219/styles/kendo.common-bootstrap.min.css" />
    <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2020.1.219/styles/kendo.bootstrap.min.css" />
    <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2020.1.219/styles/kendo.bootstrap.mobile.min.css" />
    
    
    
     <table width="100%" cellpadding="2" cellspacing="0" border="0">
            <tr>
                <th width="20%" />
                <th width="30%" />
                <th width="20%" />
                <th width="30%" />
            </tr>
            <tr>
                <td>
                    Not Kendo (does not look like Kendo in IE / Edge)
                </td>
                <td>&nbsp;</td>
                <td>
                    Kendo Stuff
                </td>
                <td>&nbsp;</td>
            </tr>
            
            <tr>
                <td>
                    checkbo
                </td>
                <td>
                    <input type="checkbox" id="cunstyled" value="1">
                    <label for="cunstyled">unstyled</label>
                </td>
                <td>&nbsp;</td>
                <td>
                    <input type="checkbox" id="styled" value="1" class="k-checkbox">
                    <label for="styled" class="k-checkbox-label">styled</label>
                </td>
            </tr>
            <tr>
                <td>
                    radio
                </td>
                <td>
                    <input type="radio" id="radio0" value="1">
                    <label for="radio0">unstyled</label>
                </td>
                <td>&nbsp;</td>
                <td>
                    <input type="radio" id="radiok" value="1" class="k-radio">
                    <label for="radiok" class="k-radio-label">styled</label>
                </td>
            </tr>
            <tr>
                <td>
                    checkbo
                </td>
                <td>
                    <input type="checkbox" id="cunstyled2" value="1" checked="checked">
                    <label for="cunstyled2">unstyled</label>
                </td>
                <td>&nbsp;</td>
                <td>
                    <input type="checkbox" id="styled2" value="1" class="k-checkbox" checked="checked">
                    <label for="styled2" class="k-checkbox-label">styled</label>
                </td>
            </tr>
            <tr>
                <td>
                    radio
                </td>
                <td>
                    <input type="radio" id="radio02" value="1" checked="checked">
                    <label for="radio02">unstyled</label>
                </td>
                <td>&nbsp;</td>
                <td>
                    <input type="radio" id="radiok2" value="1" class="k-radio" checked="checked">
                    <label for="radiok2" class="k-radio-label">styled</label>
                </td>
            </tr>
      </table>

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...