Skip to content

Commit

Permalink
fix(ref: no-ref): change to tailwind styles
Browse files Browse the repository at this point in the history
* fix(ref: no-ref): change to tailwind styles

* fix(ref: no-ref): remove comments
  • Loading branch information
andriikamaldinov1 authored Oct 25, 2024
1 parent 17d980a commit b5f37f1
Show file tree
Hide file tree
Showing 13 changed files with 145 additions and 203 deletions.
2 changes: 2 additions & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
/.angular
/test-reports
/src/coverage
/src/styles.scss

/projects/ngx-mask-lib/coverage

# Node
Expand Down
3 changes: 3 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"extends": ["stylelint-config-recommended-scss", "stylelint-prettier/recommended"],
"customSyntax": "postcss-scss",
"rules": {
"no-empty-source": null,
"scss/comment-no-empty": null,
"no-descending-specificity": null,
"selector-type-no-unknown": [
true,
{
Expand Down
Binary file modified bun.lockb
Binary file not shown.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@
"type-coverage": "^2.29.1",
"typescript": "5.5.4",
"angular-eslint": "^18.1.0",
"typescript-eslint": "^7.17.0"
"typescript-eslint": "^7.17.0",
"tailwindcss": "^3.4.14"
},
"typeCoverage": {
"atLeast": 92,
Expand Down
8 changes: 4 additions & 4 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<div class="content-wrapper column">
<div class="flex flex-col">
<jsdaddy-open-source-header [activeLink]="githubMaskLink" />
<section class="mask-wrap row">
<div class="drawer-container column">
<section class="flex overflow-auto mt-[64px]">
<div class="drawer-container flex flex-col">
<jsdaddy-open-source-accordion [lists]="lists" (switchCardIndex)="switchCard($event)" />
</div>
<div class="right-section column">
<div class="flex flex-col w-full p-0 mt-[55px] desk:mt-0 desk:pl-[310px]">
<jsdaddy-open-source-sub-header [title]="title" [subtitle]="subtitle" [chips]="chips" />
<jsdaddy-open-source-options [cardDocs]="docs()" [cardExamples]="examples()" />
<jsdaddy-open-source-footer />
Expand Down
25 changes: 1 addition & 24 deletions src/app/app.component.scss
Original file line number Diff line number Diff line change
@@ -1,26 +1,3 @@
@import '../libraries/styles/media-breakpoints';
:host {
display: block;
height: 100%;
}
.content-wrapper {
.mask-wrap {
height: calc(100% - 64px);
overflow: auto;
.right-section {
width: 100%;
padding-left: 310px;
}
}
}

@media screen and (max-width: $desktopWidth) {
.content-wrapper {
.mask-wrap {
.right-section {
padding: 0;
margin-top: 55px;
}
}
}
@apply block h-full;
}
40 changes: 24 additions & 16 deletions src/app/options/options.component.html
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
@for (tile of cardDocs(); track tile.id; let i = $index) {
<div class="card" [class]="activeCardId() | color: tile.id" [id]="tile.id" #cards>
<div class="mr-title title row uppercase ls-25">
<div
class="flex flex-col p-2.5 gap-2.5 bg-dark/[.02] rounded-15px"
[class]="
activeCardId() === tile.id ? 'border border-solid border-yellow bg-yellow/[.05]' : ''
"
[id]="tile.id"
#cards>
<div class="ml-4 flex items-center text-title text-dark uppercase tracking-[.25em]">
{{ tile.header }}
</div>

<div class="cards-block row" [id]="tile.anchor">
<div class="light-card bg-full-white pd-15">
<div class="light-title row ai-c">
<div class="flex gap-30px mob:flex-col mob:gap-15px scroll-mt-[185px]" [id]="tile.anchor">
<div class="flex-[55%] rounded-10px bg-full-white p-15px">
<div class="flex items-start gap-2.5 mb-5">
<img
width="20"
height="20"
[ngSrc]="'hand-box' | asset: openSourceOptionsPath"
alt="Hand with box" />
<span class="span">Usage</span>
<span class="text-span text-dark/[.25]">Usage</span>
</div>
<span class="source uppercase ls-25 full-white span">Source code</span>
<div class="white-input">
<pre class="row">
<code [highlight]="tile.code" language="JavaScript" class="input-view bg-white"></code>
<img height="18" width="13" [ngSrc]="'input-vector' | asset : openSourceOptionsPath" class="input-img ais-c" alt="Input vector" />
</pre>
<span class="uppercase tracking-[.25em] text-span text-dark/[.45]"
>Source code</span
>
<div class="block mt-2.5">
<pre class="flex text-span">
<code [highlight]="tile.code" language="JavaScript" class="bg-white w-full h-fit pl-15px rounded-10px border-none overflow-hidden whitespace-pre-line"></code>
<img height="18" width="13" [ngSrc]="'input-vector' | asset : openSourceOptionsPath" class="relative right-5 self-center" alt="Input vector" />
</pre>
</div>
</div>
<ng-container
Expand All @@ -32,7 +40,7 @@
}

<ng-template #exampleTmpl let-ex let-placeholder="placeholder">
<div class="dark-card bg-black">
<div class="flex-[45%] rounded-10px p-15px bg-black">
<ng-container
*ngTemplateOutlet="
!ex._pipe ? inputTemplate : pipeTemplate;
Expand All @@ -43,7 +51,7 @@
</ng-template>

<ng-template #inputTemplate let-ex let-placeholder="placeholder">
<div class="dark-input pd-15">
<div class="flex">
<input
[placeholder]="placeholder || ''"
[placeHolderCharacter]="ex._placholderCharacter || '_'"
Expand All @@ -67,9 +75,9 @@
[hiddenInput]="ex._hiddenInput || undefined"
[outputTransformFn]="ex._outputTransformFn || outputTransformFn"
[inputTransformFn]="ex._inputTransformFn || inputTransformFn"
class="customDarkInput bg-black white span" />
class="w-full h-[51px] placeholder:text-white/25 text-full-white py-3 px-5 outline-none bg-black border-b-2px border-b-white rounded-10px focus:border-b-yellow hover:border-b-yellow hover:bg-full-white/25 focus:bg-full-white/25" />
</div>
<div class="card-content row">
<div class="flex gap-50px">
<jsdaddy-open-source-card-content
[value]="ex.control.form.value | isEmpty"
title="Form Control:"
Expand Down
136 changes: 1 addition & 135 deletions src/app/options/options.component.scss
Original file line number Diff line number Diff line change
@@ -1,137 +1,3 @@
@import '../../libraries/styles/border-mixin';
@import '../../libraries/styles/media-breakpoints';

:host {
gap: 16px;
padding: 16px;
border-top: 1px solid rgba(25, 25, 25, 0.05);
box-sizing: border-box;
background-color: var(--full-white);
display: flex;
flex-direction: column;

.yellow {
&.card {
background: rgba(255, 214, 77, 0.05);
border: 1px solid var(--yellow);
}
}

.card {
padding: 10px;
gap: 10px;
background: rgba(25, 25, 25, 0.02);
border-radius: 15px;

.mr-title {
margin: 10px 0 10px 26px;
}

.cards-block {
scroll-margin-top: 185px;

.light-card {
flex: 55%;
border-radius: 10px;

.light-title {
margin-bottom: 20px;

span {
margin-left: 10px;
font-size: 16px;
color: rgba(25, 25, 25, 0.25);
}
}

.source {
font-size: 10px;
color: rgba(25, 25, 25, 0.45);
margin-bottom: 10px;
}

.white-input {
display: block;

.input-view {
width: 100%;
height: fit-content;
cursor: text;
padding-left: 15px;
border-radius: 10px;
border: none;
overflow: hidden;
white-space: pre-line;
}

.input-img {
position: relative;
right: 20px;
}
}
}

.dark-card {
flex: 45%;
border-radius: 10px;
margin-left: 30px;

.dark-input {
.customDarkInput {
@include border-bottom-grey;
border-top-left-radius: 0;
border-top-right-radius: 0;
height: 51px;
width: 100%;
padding: 12px 20px;
box-sizing: border-box;
-webkit-transition: 0.5s;
transition: 0.5s;
outline: none;

&:hover {
@include border-bottom-yellow;
background: var(--ligth-grey);
}

&[type='text']:focus {
@include border-bottom-yellow;
background: var(--ligth-grey);
}

&[type='number']:focus {
@include border-bottom-yellow;
background: var(--ligth-grey);
}
}
}
}
}
}

.pd-15 {
padding: 15px;
}

.mrl-50 {
margin-left: 50px;
}

@media screen and (max-width: $mobileWidth) {
.card {
.cards-block {
flex-direction: column;

.dark-card {
flex: 100%;
margin-left: 0;
}

.light-card {
flex: 100%;
margin-bottom: 10px;
}
}
}
}
@apply flex flex-col gap-4 p-4 bg-full-white box-border border-t border-t-black/10 py-5 pl-[22px] pr-4;
}
11 changes: 7 additions & 4 deletions src/app/shared/card-content/card-content.component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<span class="sub-text full-white title ls-25">{{ title() }}</span>
<span class="height ai-start span yellow" [class]="[color()]" [style.height]="'auto'">{{
value()
}}</span>
<span class="mb-5px text-white text-title tracking-[.25em] empty:hidden">{{ title() }}</span>
<span
class="text-span yellow px-5px gap-2.5 w-fit h-[21px] rounded-5px"
[class]="[color()]"
[style.height]="'auto'"
>{{ value() }}</span
>
21 changes: 4 additions & 17 deletions src/app/shared/card-content/card-content.component.scss
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
:host {
padding: 15px;
display: flex;
flex-direction: column;
.sub-text {
margin-bottom: 5px;
}
.green-view,
.yellow-view {
padding: 0 5px;
gap: 10px;
height: 21px;
width: fit-content;
border-radius: 5px;
}
@apply flex flex-col mt-5 text-full-white;

.green-view {
color: var(--green);
background: rgba(26, 183, 126, 0.05);
@apply text-green bg-green/[.10];
}
.yellow-view {
background: rgba(248, 248, 248, 0.05);
@apply text-yellow bg-yellow/[.10];
}
}
4 changes: 3 additions & 1 deletion src/styles.scss
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
@import './libraries/styles/general';
@tailwind base;
@tailwind components;
@tailwind utilities;
Loading

0 comments on commit b5f37f1

Please sign in to comment.