Advertisement
Guest User

Css

a guest
Oct 15th, 2019
540
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 8.06 KB | None | 0 0
  1. /*
  2.  * Сглаживание шрифтов для всей страницы, подробнее об этом —
  3.  * в уроках про адаптацию страницы под различные устройства
  4.  */
  5.  
  6. .page {
  7.   -webkit-font-smoothing: antialiased;
  8.   -moz-osx-font-smoothing: grayscale;
  9.   text-rendering: optimizeLegibility;
  10.   -webkit-text-size-adjust: 100%;
  11.   -ms-font-feature-settings: "kern" 1;
  12.   font-feature-settings: "kern";
  13. }
  14.  
  15. /*
  16.  * Всю секцию, в которой расположена форма, мы прибили
  17.  * к левому краю при помощи фиксированного позиционирования
  18.  */
  19.  
  20. .form {
  21.   width: 320px;
  22.   height: 100vh;
  23.   background: rgba(255, 255, 255, .95);
  24.   border-right: 1px solid #000;
  25.   position: fixed;
  26.   top: 0;
  27.   left: 0;
  28.   transition: left .5s;
  29.   font-family: 'Alegreya Sans', sans-serif;
  30. }
  31.  
  32. /*
  33.  * Класс, созданный для анимации секции с формой.
  34.  * Свойство left будет плавно меняться, убирая секцию
  35.  * за пределы экрана в нужный момент
  36.  */
  37.  
  38. .form_is-closed {
  39.   left: -320px;
  40. }
  41.  
  42. /* Блок с иконкой, сворачивающей и раскрывающей секцию с формой */
  43.  
  44. .form__toggle {
  45.   width: 50px;
  46.   height: 50px;
  47.   background-color: rgba(0, 0, 0, .95);
  48.   position: absolute;
  49.   top: 0;
  50.   right: -50px;
  51.   display: flex;
  52.   cursor: pointer;
  53.   transition: opacity .4s;
  54. }
  55.  
  56. .form__toggle:hover {
  57.   opacity: .8;
  58. }
  59.  
  60. .form__toggle-image {
  61.   width: 12px;
  62.   height: 20px;
  63.   margin: auto;
  64. }
  65.  
  66. /* Поворот иконки, отвечающей за анимацию секции с формой */
  67.  
  68. .form_is-closed .form__toggle-image {
  69.   transform: rotate(180deg);
  70. }
  71.  
  72. /*
  73.  * Высота контейнера вычисляется функцией calc,
  74.  * которую мы рассмотрим в уроках про адаптивную и отзывчивую верстку.
  75.  * Свойство overflow отвечает за поведение внешнего контейнера в случае,
  76.  * если содержимое не помещается в его размеры.
  77.  * В данном случае — появится вертикальная прокрутка.
  78.  */
  79.  
  80. .form__main-container {
  81.   height: calc(100vh - 40px);
  82.   overflow-y: scroll;
  83. }
  84.  
  85. /* Заголовок формы */
  86.  
  87. .form__heading {
  88.   font-size: 28px;
  89.   line-height: 32px;
  90.   width: 240px;
  91.   margin: 23px auto 0;
  92. }
  93.  
  94. /* Непосредственно форма */
  95.  
  96. .form__admin {
  97.   height: 100vh;
  98. }
  99.  
  100. /* Стили всех элементов fieldset */
  101.  
  102. .form__input-container {
  103.   width: 240px;
  104.   margin: auto;
  105.   padding-bottom: 50px;
  106.   border: 0;
  107. }
  108.  
  109. /* Линия-разделитель между fieldset'ами */
  110.  
  111. .form__line {
  112.   height: 1px;
  113.   background-color: #000;
  114. }
  115.  
  116. /* Общие стили для всех лейблов */
  117.  
  118. .form__label {
  119.   display: block;
  120.   margin: 35px auto 0;
  121.   font-size: 20px;
  122.   line-height: 30px;
  123. }
  124.  
  125. /* Общие стили для всех полей ввода */
  126.  
  127. .form__item {
  128.   border: 0;
  129.   width: 100%;
  130.   height: 24px;
  131.   box-sizing: border-box;
  132.   border-bottom: 1px solid #bcbcc4;
  133.   background-color: transparent;
  134.   margin-top: 5px;
  135.   font-size: 14px;
  136.   font-family: inherit;
  137. }
  138.  
  139. /* Замена цвета внешней линии при фокусе поля ввода */
  140. .form__item[type="text"]:focus, .form__item[type="number"]:focus, .form__item[type="date"]:focus, .form__item[type="color"]:focus, .form__item[type="range"]:focus, select.form__item:focus, .form__item[type="radio"]:focus, .form__item[type="radio"][value="row"]:focus, .form__item[type="checkbox"]:focus, .form__item[type="email"]:focus, textarea.form__item:focus {
  141.   outline-color: #fff6c5;
  142. }
  143.  
  144. /* Стилизуем плейсхолдеры */
  145.  
  146. /* Поля ввода */
  147.  
  148. /* Селектор класса поля ввода основного текста */
  149. .form__item[type="mainText"] {
  150.   background: #fff;
  151.   height: 150px;
  152.   font-size: 14px;
  153.   padding: 6px 6px 4px;
  154.   border: 1px solid #bcbcc4;
  155. }
  156.  
  157.  
  158. /* Селектор поля ввода с типом "число" */
  159. .form__item[type="number"] {
  160.   background-color: white;
  161.   color: black;
  162.   border: 1px solid #bcbcc4;
  163.   padding: 0 4px;
  164. }
  165.  
  166.  
  167. /* Селектор поля ввода с типом "дата" */
  168. .form__item[type="date"]{
  169.   background-color: white;
  170.   color: black;
  171.   border: 1px solid #bcbcc4;
  172.   padding: 0 4px;
  173.   font-family: 'Alegreya Sans', sans-serif;
  174. }
  175.  
  176. /* Селектор поля ввода с типом "цвет"*/
  177. .form__item[type="color"] {
  178.   height: 30px;
  179.   width: 48px;
  180.   border-bottom: 0;
  181.   padding: 0;
  182. }
  183.  
  184.  
  185. /* Селектор поля ввода с типом "диапазон" */
  186. .form__item[type="range"] {
  187.   width: 144px;
  188. }
  189.  
  190. /* Поле выпадающего списка с классом form_item */
  191. select.form__item {
  192.   background-color: white;
  193.   color: black;
  194.   border: 1px solid #bcbcc4;
  195. }
  196.  
  197.  
  198. /* Селектор поля единичного выбора */
  199. .form__item[type="radio"] {
  200.   display: inline-block;
  201.   width: 16px;
  202.   height: 16px;
  203. }
  204.  
  205. /* Селектор поля единичного выбора со значением атрибута value "row" */
  206. .form__item[type="radio"][value="row"] {
  207.   margin-left: 25px;
  208. }
  209.  
  210.  
  211. /* Селектор поля множественного выбора  */
  212. .form__item[type="checkbox"] {
  213.   display: inline-block;
  214.   width: 16px;
  215.   height: 16px;
  216.   vertical-align: middle;
  217.   margin: 0;
  218. }
  219.  
  220. .form__descriptor {
  221.   font-size: 14px;
  222.   line-height: 30px;
  223.   margin-left: 10px;
  224. }
  225.  
  226. /* Зона кнопок и сами кнопки */
  227.  
  228. .form__handlers {
  229.   border: 0;
  230.   margin: 0;
  231.   width: 320px;
  232.   font-size: 0;
  233.   height: 40px;
  234. }
  235.  
  236. /* Общие стили для всех кнопок */
  237.  .form__button {
  238.   width: 50%;
  239.   height: 40px;
  240.   font-size: 14px;
  241.   border: 0;
  242.   margin: 0;
  243.   padding-bottom: 5px;
  244.   cursor: pointer;
  245.   transition: opacity .4s;
  246.   color: white;
  247.   font-family: inherit;
  248. }
  249.  
  250. .form__button:hover {
  251.   opacity: .7;
  252. }
  253.  
  254.  
  255. /* Замена цвета внешней линии при фокусе кнопки */
  256. .form__button[type="submit"]:focus, .form__button[type="reset"]:focus {
  257.   outline-color: #fff6c5;
  258. }
  259.  
  260. /* Селектор кнопки отправки данных */
  261. .form__button[type="submit"]{
  262.   background-color: #000;
  263. }
  264.  
  265. /* Селектор кнопки сброса формы */
  266. .form__button[type="reset"] {
  267.   background-color: #ea3a3a;
  268. }
  269.  
  270. /* Стили страницы */
  271.  
  272. .content {
  273.   font-family: 'Playfair Display', serif;
  274.   width: 90%;
  275.   margin: 0 auto;
  276.   padding-top: 60px;
  277. }
  278.  
  279. .content__heading {
  280.   font-size: 55px;
  281.   width: 523px;
  282.   margin: auto;
  283.   line-height: 60px;
  284.   text-align: center;
  285.   font-weight: bold;
  286. }
  287.  
  288. .content__subheading {
  289.   text-align: center;
  290.   width: 430px;
  291.   font-size: 20px;
  292.   line-height: 30px;
  293.   margin: 40px auto;
  294. }
  295.  
  296. .content__image-item {
  297.   width: 100%;
  298. }
  299.  
  300. .content__image-copyright {
  301.   font-size: 14px;
  302.   margin-top: 20px;
  303. }
  304.  
  305. /*
  306.  * В этом элементе мы применяем свойства column-count
  307.  * и column-gap, они новые для вас.
  308.  * Эти свойства разбивают текст на колонки.
  309.  * column-count: 1; — означает текст в одну колонку
  310.  * column-gap: 40px; — рекомендуемое расстояние между колонками
  311.  */
  312.  
  313. .content__text {
  314.   width: 70%;
  315.   font-size: 20px;
  316.   line-height: 30px;
  317.   margin: 30px auto;
  318.   column-count: 1;
  319.   column-gap: 40px;
  320. }
  321.  
  322. .content__paragraph {
  323.   margin: 30px 0;
  324. }
  325.  
  326. .content__link {
  327.   color: black;
  328. }
  329.  
  330. .content__date {
  331.   font-size: 20px;
  332.   width: 70%;
  333.   margin: 90px auto 0;
  334.   text-decoration: underline;
  335. }
  336.  
  337. .content__author {
  338.   font-size: 20px;
  339.   width: 70%;
  340.   margin: 20px auto 0;
  341. }
  342.  
  343. .footer__container {
  344.   height: 100px;
  345. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement