Skip to content

Commit

Permalink
issue-#1, #2 - Added basic top-nav toggle.
Browse files Browse the repository at this point in the history
- Removed some unused css files.
  • Loading branch information
elycruz committed Jun 6, 2023
1 parent 02e681d commit da624fa
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 73 deletions.
3 changes: 0 additions & 3 deletions apps/atomic-ui-js-site/src/app/globals.css

This file was deleted.

12 changes: 7 additions & 5 deletions apps/atomic-ui-js-site/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import '../css/index.scss';
import {AppNav} from '../features/app-nav';
import {AppNavToggle} from '@/components/app-nav-toggle';

export const metadata = {
title: 'Atomic UI Js'
Expand All @@ -17,11 +18,12 @@ export default function RootLayout({
<html lang="en">
<body>
<header className="x-app-header">
<div>
<div className="x-app-header__title x-flex x-flex-row x-align-items-center">
<button className="x-hamburger-btn x-btn"><i className="mds-icon">menu</i></button>
<h1>Atomic UI Js</h1>
</div>
<div className=" x-flex x-flex-row x-align-items-center">
<AppNavToggle />

<hgroup className="x-app-header__start">
<a href="/atomic-ui-js"><h1 className="x-app-header__title">Atomic UI Js</h1></a>
</hgroup>
</div>
</header>

Expand Down
15 changes: 15 additions & 0 deletions apps/atomic-ui-js-site/src/components/app-nav-toggle/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use client';

import React from 'react';

export function AppNavToggle() {
const onClick = e => {
e.preventDefault();
e.currentTarget.ownerDocument.documentElement.classList.toggle('with-app-nav-hidden');
};

return (
<button className="x-hamburger-btn x-btn"
onClick={onClick}><i className="mds-icon">menu</i></button>
);
}
13 changes: 3 additions & 10 deletions apps/atomic-ui-js-site/src/css/index.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@use "atomic-ui-js/dist/index.min.css";
@use "atomic-ui-js/dist/index.min.css";

* {
box-sizing: border-box;
Expand All @@ -19,16 +19,9 @@ body > * > * {
body > .x-app-header {
grid-area: app-header;
border-bottom: var(--x-1px) solid;
}

body .x-app-header__title {
gap: 0.5rem;
}

body .x-app-header__title > * {
display: inline-block;
}

body > div {
grid-area: app-main;
display: inline-grid;
Expand Down Expand Up @@ -57,6 +50,6 @@ body > .x-app-content > .x-app-nav {
padding: var(--x-8px);
}

html.x-nav-hidden main {
width: 100vw;
html.with-app-nav-hidden .x-app-nav {
display: none;
}
Empty file.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {debounce, $, $$} from './utils/index.js';
import {debounce, $, $$} from '../utils/index.js';

// Init
// ----
Expand Down
108 changes: 54 additions & 54 deletions packages/atomic-ui-js/css/base/copy.css
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
h1, h2, h3, h4, h5, h6, figure {
margin: 0;
}

h1,
.x-h1 {
font-size: var(--x-72px);
line-height: var(--x-72px);
}

h2,
.x-h2 {
font-size: var(--x-48px);
line-height: var(--x-48px);
}

h3,
.x-h3 {
font-size: var(--x-36px);
line-height: var(--x-36px);
}

h4,
.x-h4 {
font-size: var(--x-24px);
line-height: var(--x-24px);
}

h5,
.x-h5 {
font-size: var(--x-18px);
line-height: var(--x-18px);
}

h6,
.x-h6 {
font-size: var(--x-16px);
line-height: var(--x-16px);
}

a, p {
font-size: var(--x-16px);
line-height: var(--x-24px);
}

dl dd + *,
dl dt + *,
dl + dl {
margin-top: var(--x-21px);
}

dt, label {
font-weight: bold;
}
h1, h2, h3, h4, h5, h6, figure {
margin: 0;
}

h1,
.x-h1 {
font-size: var(--x-72px);
line-height: var(--x-72px);
}

h2,
.x-h2 {
font-size: var(--x-48px);
line-height: var(--x-48px);
}

h3,
.x-h3 {
font-size: var(--x-36px);
line-height: var(--x-36px);
}

h4,
.x-h4 {
font-size: var(--x-24px);
line-height: var(--x-24px);
}

h5,
.x-h5 {
font-size: var(--x-18px);
line-height: var(--x-18px);
}

h6,
.x-h6 {
font-size: var(--x-16px);
line-height: var(--x-16px);
}

a, p {
font-size: var(--x-16px);
line-height: var(--x-24px);
}

dl dd + *,
dl dt + *,
dl + dl {
margin-top: var(--x-21px);
}

dt, label {
font-weight: bold;
}

0 comments on commit da624fa

Please sign in to comment.