Skip to content

Commit

Permalink
🪠 Enforces smacss
Browse files Browse the repository at this point in the history
  • Loading branch information
luxonauta committed Nov 3, 2024
1 parent ac9e6fe commit 12dfe17
Show file tree
Hide file tree
Showing 18 changed files with 183 additions and 160 deletions.
5 changes: 4 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"singleQuote": false,
"trailingComma": "none"
"trailingComma": "none",
"plugins": ["prettier-plugin-css-order"],
"cssDeclarationSorterKeepOverrides": true,
"cssDeclarationSorterOrder": "smacss"
}
4 changes: 1 addition & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
"prettier.configPath": "./.prettierrc"
}
58 changes: 29 additions & 29 deletions dist/expanded/luxa.css
Original file line number Diff line number Diff line change
Expand Up @@ -205,88 +205,88 @@ img {
}

hr {
display: block;
width: 100%;
height: 0.125em;
margin: 0;
padding: 0;
display: block;
border: none;
}

.container-50 {
width: 50%;
max-width: 60rem;
min-width: 10rem;
max-width: 60rem;
margin: 0 auto;
}
.container-55 {
width: 55%;
max-width: 66rem;
min-width: 11rem;
max-width: 66rem;
margin: 0 auto;
}
.container-60 {
width: 60%;
max-width: 72rem;
min-width: 12rem;
max-width: 72rem;
margin: 0 auto;
}
.container-65 {
width: 65%;
max-width: 78rem;
min-width: 13rem;
max-width: 78rem;
margin: 0 auto;
}
.container-70 {
width: 70%;
max-width: 84rem;
min-width: 14rem;
max-width: 84rem;
margin: 0 auto;
}
.container-75 {
width: 75%;
max-width: 90rem;
min-width: 15rem;
max-width: 90rem;
margin: 0 auto;
}
.container-80 {
width: 80%;
max-width: 96rem;
min-width: 16rem;
max-width: 96rem;
margin: 0 auto;
}
.container-85 {
width: 85%;
max-width: 102rem;
min-width: 17rem;
max-width: 102rem;
margin: 0 auto;
}
.container-90 {
width: 90%;
max-width: 108rem;
min-width: 18rem;
max-width: 108rem;
margin: 0 auto;
}
.container-95 {
width: 95%;
max-width: 114rem;
min-width: 19rem;
max-width: 114rem;
margin: 0 auto;
}
.container-100 {
width: 100%;
max-width: 120rem;
min-width: 20rem;
max-width: 120rem;
margin: 0 auto;
}

.row {
width: 100%;
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items: center;
justify-content: center;
width: 100%;
gap: var(--gap);
}
.row.is-gapless {
Expand All @@ -295,57 +295,57 @@ hr {

.col {
display: block;
flex-basis: 0;
flex-grow: 1;
flex-shrink: 1;
flex-basis: 0;
}
.col.is-1 {
width: 8.3333333333%;
flex: none;
width: 8.3333333333%;
}
.col.is-2 {
width: 16.6666666667%;
flex: none;
width: 16.6666666667%;
}
.col.is-3 {
width: 25%;
flex: none;
width: 25%;
}
.col.is-4 {
width: 33.3333333333%;
flex: none;
width: 33.3333333333%;
}
.col.is-5 {
width: 41.6666666667%;
flex: none;
width: 41.6666666667%;
}
.col.is-6 {
width: 50%;
flex: none;
width: 50%;
}
.col.is-7 {
width: 58.3333333333%;
flex: none;
width: 58.3333333333%;
}
.col.is-8 {
width: 66.6666666667%;
flex: none;
width: 66.6666666667%;
}
.col.is-9 {
width: 75%;
flex: none;
width: 75%;
}
.col.is-10 {
width: 83.3333333333%;
flex: none;
width: 83.3333333333%;
}
.col.is-11 {
width: 91.6666666667%;
flex: none;
width: 91.6666666667%;
}
.col.is-12 {
width: 100%;
flex: none;
width: 100%;
}

@media screen and (max-width: 64rem) {
Expand Down Expand Up @@ -477,16 +477,16 @@ hr {
}

.sr-only {
opacity: 0;
position: absolute;
width: 0;
height: 0;
margin: 0;
padding: 0;
position: absolute;
overflow: hidden;
opacity: 0;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: none;
white-space: nowrap;
}

@media screen and (max-width: 64rem) {
Expand Down
10 changes: 5 additions & 5 deletions docs/recipes/badge.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ Badges can indicate notifications, item counts, or other information related to

```scss
.badge {
padding: 0.5em 0.75em;
display: inline-flex;
align-items: center;
padding: 0.5em 0.75em;
gap: 0.5em;
border: 0.0625rem solid var(--neutral-03);
border-radius: var(--rounded-sm);
line-height: 1;
font-size: 1em;
font-weight: 500;
color: var(--neutral-09);
background-color: var(--neutral-01);
color: var(--neutral-09);
font-weight: 500;
font-size: 1em;
line-height: 1;
transition: border-color 240ms var(--fluid);

.status {
Expand Down
10 changes: 5 additions & 5 deletions docs/src/components/ad/index.scss
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
.ad {
width: calc(10rem + 0.5rem) !important;
position: absolute;
top: 0;
left: calc(100% + var(--space-04));
width: calc(10rem + 0.5rem) !important;

#carbonads {
#carbon-responsive {
a {
color: inherit !important;
font-size: 0.75rem !important;
line-height: 1.8 !important;
font-family: var(--font-inter) !important;
font-size: 0.75rem !important;
color: inherit !important;
}

.carbon-responsive-wrap {
Expand All @@ -20,13 +20,13 @@
gap: 0.5rem !important;
border: 0.0625rem solid var(--neutral-04) !important;
border-radius: var(--rounded-sm) !important;
text-wrap: balance !important;
background-color: var(--neutral-01) !important;
text-wrap: balance !important;
transition: border-color 240ms var(--fluid) !important;

.carbon-img {
width: 100% !important;
flex: none !important;
width: 100% !important;

img {
width: 100% !important;
Expand Down
72 changes: 48 additions & 24 deletions docs/src/components/docs/aside/index.scss
Original file line number Diff line number Diff line change
@@ -1,77 +1,101 @@
aside {
width: 12rem;
display: flex;
position: absolute;
transform: translateX(-100%);
top: 0;
left: calc(-1 * var(--space-04));
display: flex;
flex-direction: column;
width: 12rem;
gap: var(--space-02);
transition: border-color 240ms var(--fluid);
transform: translateX(-100%);
transition: all 240ms var(--fluid);
will-change: transform, border-color;

nav {
width: 100%;
padding: var(--space-02) var(--space-01) var(--space-02) var(--space-02);
border: 0.0625rem solid var(--neutral-04);
border-radius: var(--rounded-sm);
transition: border-color 240ms var(--fluid);
}

ul {
--gap: 0.5em;
list-style: none;
--gap: 0;
width: 100%;
margin: 0;
padding: 0;
list-style: none;

li {
&:first-child {
a {
padding-top: 0;
}
}

&:last-child {
a {
padding-bottom: 0;
}
}
}

a {
display: flex;
position: relative;
align-items: center;
padding: 0.25rem 0;
gap: 0.5rem;
text-decoration: none;
font-weight: 500;
color: var(--neutral-09);
transition: color 140ms var(--fluid);
font-weight: 500;
text-decoration: none;
transition:
color 200ms var(--fluid),
transform 200ms var(--fluid);

&::before {
content: "";
opacity: 0;
width: 0;
height: 0;
position: relative;
transform: translateX(-100%);
display: block;
position: absolute;
left: -0.75rem;
width: 0.25rem;
height: 0.25rem;
transform: scale(0);
border-radius: 100%;
background-color: var(--neutral-11);
transition:
transform,
opacity 240ms var(--fluid);
content: "";
opacity: 0;
transition: all 200ms var(--fluid);
will-change: transform, opacity;
}

&:hover {
transform: translateX(0.25rem);
color: var(--neutral-11);
}

&.is-active {
transform: translateX(0.625rem);
color: var(--neutral-11);

&::before {
transform: scale(1);
opacity: 1;
width: 0.25rem;
height: 0.25rem;
transform: translateX(-50%);
}
}
}
}

&:focus-within,
&:hover {
border-color: var(--neutral-05);
nav {
border-color: var(--neutral-05);
}
}

@media (max-width: 64rem) {
width: 100%;
position: relative;
transform: none;
top: unset;
left: unset;
width: 100%;
transform: none;
}
}
Loading

0 comments on commit 12dfe17

Please sign in to comment.