_icons.scss 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624
  1. .icon {
  2. width: divide(16, 15) * 1em;
  3. height: divide(16, 15) * 1em;
  4. stroke-width: 2;
  5. vertical-align: -.2em;
  6. }
  7. .icon-svg {
  8. display: inline-block;
  9. line-height: 1;
  10. }
  11. .icon-md {
  12. width: 1.5rem;
  13. height: 1.5rem;
  14. stroke-width: 1;
  15. }
  16. .icon-lg {
  17. width: 3rem;
  18. height: 3rem;
  19. stroke-width: 1;
  20. }
  21. .icon-muted {
  22. color: $color-muted-light;
  23. }
  24. .icon-filled {
  25. fill: currentColor;
  26. }
  27. .icon-inline {
  28. width: 1.2em;
  29. height: 1.2em;
  30. stroke-width: 1.5;
  31. stroke: currentColor;
  32. vertical-align: sub;
  33. }
  34. .icon-items {
  35. --icon-min-width: 7rem;
  36. display: grid;
  37. grid-gap: var(--grid-gap);
  38. grid-template-columns: repeat(auto-fit, minmax(var(--icon-min-width), 1fr));
  39. @include media-breakpoint-up(md) {
  40. --icon-min-width: 7rem;
  41. }
  42. @include media-breakpoint-up(lg) {
  43. --icon-min-width: 8rem;
  44. }
  45. }
  46. .icon-item {
  47. display: flex;
  48. flex-direction: column;
  49. align-items: center;
  50. justify-content: center;
  51. border-radius: $border-radius;
  52. text-align: center;
  53. color: inherit;
  54. padding: $gap-4 $gap-2;
  55. min-height: var(--icon-min-width);
  56. text-decoration: none;
  57. border: 1px solid $color-border-light;
  58. background: $color-background;
  59. transition: .3s border-color;
  60. position: relative;
  61. &:hover {
  62. border-color: $color-primary;
  63. transition-delay: .3s;
  64. }
  65. .icon {
  66. width: var(--icon-size, 1.5rem);
  67. height: var(--icon-size, 1.5rem);
  68. stroke-width: var(--icon-stroke, 2);
  69. color: var(--icon-color, currentColor);
  70. }
  71. }
  72. .icon-item-new-wrap {
  73. position: absolute;
  74. top: .5rem;
  75. right: .5rem;
  76. }
  77. .icon-item-new {
  78. width: $gap-2;
  79. height: $gap-2;
  80. background: $color-red;
  81. border-radius: 100%;
  82. display: block;
  83. }
  84. .icon-item-text {
  85. @include text-truncate;
  86. color: $color-muted;
  87. font-size: $font-size-h6;
  88. margin-top: $gap-3;
  89. margin-bottom: -$gap-2;
  90. }
  91. .icon-item-icon {
  92. display: flex;
  93. width: 2.5rem;
  94. height: 2.5rem;
  95. align-items: center;
  96. justify-content: center;
  97. }
  98. .icons-wizard {
  99. position: sticky;
  100. user-select: none;
  101. top: 1rem;
  102. bottom: 1rem;
  103. }
  104. .icons-search {
  105. display: block;
  106. position: sticky;
  107. top: $gap-1;
  108. background: $color-background;
  109. padding: 1rem 0 0;
  110. z-index: 2;
  111. &:after {
  112. content: '';
  113. position: absolute;
  114. top: 100%;
  115. left: 0;
  116. right: 0;
  117. height: 2rem;
  118. pointer-events: none;
  119. z-index: -1;
  120. background: linear-gradient(to bottom, $color-background, rgba(#fff, 0));
  121. }
  122. }
  123. .icons-header {
  124. scroll-margin: 3.75rem;
  125. }
  126. .icon-preview {
  127. border-radius: $border-radius;
  128. border: 1px solid $color-border;
  129. background: $color-white url-svg('<svg viewBox="0 0 8 8"><polyline points="0 8 8 8 8 0 7 0 7 7 0 7" fill="#{rgba(0, 0, 0, .02)}" /></svg>') repeat 0 0/4px 4px;
  130. line-height: 1;
  131. width: 6rem;
  132. height: 6rem;
  133. position: relative;
  134. @include media-breakpoint-up(sm) {
  135. background-size: 8px 8px;
  136. width: 12rem;
  137. height: 12rem;
  138. .icon-preview-slider {
  139. display: block;
  140. }
  141. &:hover {
  142. .icon-preview-slider {
  143. opacity: 1;
  144. }
  145. }
  146. }
  147. }
  148. .icon-preview-svg {
  149. position: absolute;
  150. top: 0;
  151. left: 0;
  152. right: 0;
  153. bottom: 0;
  154. display: flex;
  155. align-items: center;
  156. justify-content: center;
  157. .icon {
  158. width: var(--icon-size, 100%);
  159. height: var(--icon-size, 100%);
  160. stroke-width: var(--icon-stroke, 2);
  161. transform: rotate(var(--icon-rotate, 0deg))
  162. }
  163. }
  164. .icon-preview-auto {
  165. display: block;
  166. width: 100%;
  167. height: auto;
  168. background: none;
  169. border: 0;
  170. &:before {
  171. content: '';
  172. display: block;
  173. padding-top: 100%;
  174. }
  175. }
  176. .icon-preview-big {
  177. background-size: 8px 8px;
  178. width: 12rem;
  179. height: 12rem;
  180. @include media-breakpoint-up(md) {
  181. background-size: 12px 12px;
  182. width: 18rem;
  183. height: 18rem;
  184. }
  185. @include media-breakpoint-up(lg) {
  186. background-size: 16px 16px;
  187. width: 24rem;
  188. height: 24rem;
  189. }
  190. }
  191. .icon-preview-slider {
  192. display: none;
  193. background: $color-background;
  194. padding: 1rem;
  195. position: absolute;
  196. bottom: 0;
  197. left: 0;
  198. right: 0;
  199. line-height: $line-height-base;
  200. opacity: 0;
  201. transition: .3s opacity;
  202. }
  203. .icon-code-grid {
  204. display: grid;
  205. gap: 1.5rem;
  206. grid-template-areas: "a" "b" "c";
  207. > :nth-child(1) {
  208. grid-area: a;
  209. }
  210. > :nth-child(2) {
  211. grid-area: b;
  212. }
  213. > :nth-child(3) {
  214. grid-area: c;
  215. }
  216. @include media-breakpoint-up(sm) {
  217. grid-template-columns: auto 1fr;
  218. grid-template-areas: "a b" "c c";
  219. }
  220. @include media-breakpoint-up(lg) {
  221. gap: 2rem;
  222. grid-template-rows: auto 1fr;
  223. grid-template-columns: auto 1fr;
  224. grid-template-areas: "a b" "a c";
  225. }
  226. }
  227. .icon-demos-grid {
  228. display: grid;
  229. gap: 1rem;
  230. grid-template-areas: "a" "b" "c" "d" "e" "f" "g" "h" "i";
  231. @include media-breakpoint-up(md) {
  232. grid-template-columns: 1fr 1fr 1fr 1fr;
  233. grid-template-areas:
  234. "a a a a"
  235. "b b e e"
  236. "g g f f"
  237. "c h h h"
  238. "d i i i";
  239. }
  240. @include media-breakpoint-up(lg) {
  241. grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
  242. grid-template-areas:
  243. "a a a a b b"
  244. "a a a a c d"
  245. "e e f f g g"
  246. "h h h i i i";
  247. }
  248. > :nth-child(1) {
  249. grid-area: a;
  250. }
  251. > :nth-child(2) {
  252. grid-area: b;
  253. }
  254. > :nth-child(3) {
  255. grid-area: c;
  256. }
  257. > :nth-child(4) {
  258. grid-area: d;
  259. }
  260. > :nth-child(5) {
  261. grid-area: e;
  262. }
  263. > :nth-child(6) {
  264. grid-area: f;
  265. }
  266. > :nth-child(7) {
  267. grid-area: g;
  268. }
  269. > :nth-child(8) {
  270. grid-area: h;
  271. }
  272. > :nth-child(9) {
  273. grid-area: i;
  274. }
  275. }
  276. .icon-demo-inline {
  277. svg {
  278. @extend .icon-inline;
  279. }
  280. }
  281. .icon-demo {
  282. background: $color-gray;
  283. min-height: 8rem;
  284. border-radius: $border-radius;
  285. display: flex;
  286. align-items: center;
  287. justify-content: center;
  288. user-select: none;
  289. line-height: 1;
  290. color: $color-muted;
  291. padding: 1rem;
  292. flex-wrap: wrap;
  293. overflow: hidden;
  294. @include media-breakpoint-up(md) {
  295. padding: 2rem;
  296. }
  297. }
  298. .icon-demo-icon {
  299. position: relative;
  300. margin: 0 $gap-1;
  301. .icon-item-new {
  302. top: -$gap-1;
  303. right: -$gap-1;
  304. }
  305. }
  306. @keyframes pulse-keyframes {
  307. from {
  308. opacity: 1;
  309. transform: scale3d(.8, .8, .8);
  310. }
  311. 50% {
  312. transform: scale3d(1, 1, 1);
  313. opacity: 1;
  314. }
  315. to {
  316. opacity: 1;
  317. transform: scale3d(.8, .8, .8);
  318. }
  319. }
  320. @keyframes tada-keyframes {
  321. 0% {
  322. transform: scale3d(1, 1, 1);
  323. }
  324. 5%, 10% {
  325. transform: scale3d(.9, .9, .9) rotate3d(0, 0, 1, -5deg);
  326. }
  327. 15%, 25%, 35%, 45% {
  328. transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 5deg);
  329. }
  330. 20%, 30%, 40% {
  331. transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -5deg);
  332. }
  333. 50% {
  334. transform: scale3d(1, 1, 1);
  335. }
  336. }
  337. .icon-pulse {
  338. display: block;
  339. transition: all 0.15s ease 0s;
  340. animation: pulse-keyframes 2s ease infinite;
  341. animation-fill-mode: both;
  342. }
  343. .icon-tada {
  344. display: block;
  345. transition: all 0.15s ease 0s;
  346. animation: tada-keyframes 3s ease infinite;
  347. animation-fill-mode: both;
  348. }
  349. @for $i from 3 through 9 {
  350. .icon-demo-stroke-#{$i * 25} svg {
  351. stroke-width: $i * .25;
  352. }
  353. }
  354. @for $i from 1 through 32 {
  355. .icon-demo-size-#{$i * 4} svg {
  356. width: $i * 4px;
  357. height: $i * 4px;
  358. }
  359. }
  360. .icon-demo-input {
  361. border: 1px solid $color-border;
  362. border-radius: $border-radius;
  363. background: $color-background;
  364. display: flex;
  365. align-items: center;
  366. padding: $gap-2 $gap-3;
  367. color: $color-muted;
  368. min-width: 15rem;
  369. svg {
  370. margin-right: $gap-3;
  371. }
  372. }
  373. .icon-demo-message {
  374. display: flex;
  375. line-height: $line-height-base;
  376. background: $color-background;
  377. border: 1px solid $color-border;
  378. border-radius: $border-radius;
  379. color: $color-muted;
  380. }
  381. .icon-demo-message-icon {
  382. padding: 1rem;
  383. border-right: 1px solid $color-border;
  384. display: flex;
  385. align-items: center;
  386. color: $color-muted;
  387. svg {
  388. width: 2.5rem;
  389. height: 2.5rem;
  390. }
  391. }
  392. .icon-demo-message-text {
  393. padding: 1rem;
  394. }
  395. .icons-card {
  396. display: block;
  397. color: inherit;
  398. background: $color-white;
  399. border-radius: $border-radius;
  400. box-shadow: $shadow-card;
  401. padding: 1rem;
  402. user-select: none;
  403. height: 100%;
  404. @include media-breakpoint-up(lg) {
  405. padding: 2rem;
  406. }
  407. @at-root a#{&} {
  408. position: relative;
  409. transition: .3s background;
  410. .icons-card-layer {
  411. content: '';
  412. position: absolute;
  413. border-radius: inherit;
  414. left: 0;
  415. right: 0;
  416. bottom: 0;
  417. z-index: 1;
  418. display: flex;
  419. align-items: center;
  420. justify-content: center;
  421. padding: 2.5rem;
  422. padding-top: 5rem;
  423. color: $color-primary;
  424. background: linear-gradient(to bottom, rgba(mix($color-primary, #fff, 10%), .5), mix($color-primary, #fff, 10%) 45%);
  425. font-size: $font-size-h6;
  426. text-transform: uppercase;
  427. font-weight: $font-weight-medium;
  428. opacity: 0;
  429. visibility: hidden;
  430. transition: .3s opacity, .3s visibility;
  431. svg {
  432. display: inline-block;
  433. margin-right: .25rem;
  434. stroke-width: 2;
  435. width: 1rem;
  436. height: 1rem;
  437. }
  438. }
  439. &:hover {
  440. color: $color-primary;
  441. background: mix($color-primary, #fff, 10%);
  442. .icons-card-title,
  443. .icons-card-placeholder {
  444. color: inherit;
  445. }
  446. .icons-card-layer {
  447. opacity: 1;
  448. visibility: visible;
  449. }
  450. }
  451. }
  452. }
  453. .icons-card-title {
  454. color: $color-muted-light;
  455. font-size: $font-size-h6;
  456. text-transform: uppercase;
  457. margin-bottom: 1rem;
  458. display: block;
  459. letter-spacing: $tracking-wide;
  460. transition: .3s color;
  461. }
  462. .icons-card-list {
  463. display: flex;
  464. flex-wrap: wrap;
  465. }
  466. .icons-card-icon,
  467. .icons-card-placeholder {
  468. width: 1.5rem;
  469. height: 1.5rem;
  470. margin: .5rem;
  471. vertical-align: bottom;
  472. transition: .3s color;
  473. .icon {
  474. width: 1.5rem;
  475. height: 1.5rem;
  476. }
  477. }
  478. .icons-card-placeholder {
  479. display: inline-flex;
  480. font-size: $font-size-h7;
  481. align-items: center;
  482. justify-content: center;
  483. color: $color-muted;
  484. }
  485. // Icon search
  486. .icon-search-wrap {
  487. position: relative;
  488. top: -3rem;
  489. }
  490. .icon-search {
  491. padding: 0 .75rem;
  492. border: 1px solid $color-border;
  493. border-radius: 3px;
  494. background: $color-white;
  495. position: sticky;
  496. top: 0;
  497. cursor: text;
  498. display: block;
  499. transition: .3s border-color, .3s box-shadow;
  500. &:focus-within {
  501. box-shadow: 0 0 0 4px rgba($color-primary, .1);
  502. border-color: rgba($color-primary, .5);
  503. .icon-search-icon {
  504. color: $color-primary;
  505. }
  506. }
  507. }
  508. .icon-search-input {
  509. border: 0;
  510. padding: .75rem 0;
  511. font: inherit;
  512. width: 100%;
  513. &::placeholder {
  514. color: rgba($color-muted, .75);
  515. }
  516. }
  517. .icon-search-select {
  518. border: 0;
  519. padding: .75rem 0;
  520. font: inherit;
  521. appearance: none;
  522. }
  523. .icon-search-icon {
  524. pointer-events: none;
  525. color: $color-muted;
  526. width: 1.5rem;
  527. height: 1.5rem;
  528. stroke-width: 1.5;
  529. }