Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(style): various styling updates #235

Merged
merged 1 commit into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dev.core": "nx start @go-ui/core",
"dev.docs": "nx build @go-ui/core && concurrently --kill-others \"npm:watch.ia\" \"nx start @go-ui/docs\"",
"dev.react.app": "nx start @go-ui/react-starter",
"dev.vue.app": "nx dev @go-ui/vue-starter",
"dev.vue": "nx dev @go-ui/vue",
"build.libs": "pnpm --stream -r --filter \"./packages/**\" build",
"build.docs": "nx build @go-ui/docs",
"build.ia": "nx build.ia @go-ui/docs",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@ go-fieldset {
@include unstyled-list;
}
}

.go-field {
margin-top: 0;
}
}
6 changes: 4 additions & 2 deletions packages/core/src/components/go-overlay/go-overlay.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ go-overlay {
}
.overlay-bg {
position: absolute;
width: 100%;
height: 100vh;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.overlay-content {
position: relative;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ go-main-nav {
text-decoration: none;
background: var(--nav-item-bg-color);
border-bottom: var(--nav-item-current-bar-width) solid transparent;
@include transition(background);
&:hover,
&:focus {
border-radius: var(--radius-2);
background: var(--nav-item-hover-bg-color);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ go-nav-link {
}

a.nav-item-link {
@include transition(background);
.nav-link-text {
@include underline;
}
Expand Down
17 changes: 11 additions & 6 deletions packages/core/src/global/scss/_spacing.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,19 @@ $directions: (
'b': 'bottom',
'': '',
);
$spacer: 1rem;
$spacer: 0.5rem;
$spacers: (
0: 0,
1: $spacer * 0.25,
2: $spacer * 0.5,
3: $spacer,
4: $spacer * 1.5,
5: $spacer * 3,
1: $spacer,
2: 2 * $spacer,
3: 3 * $spacer,
4: 4 * $spacer,
5: 5 * $spacer,
6: 6 * $spacer,
7: 7 * $spacer,
8: 8 * $spacer,
9: 9 * $spacer,
10: 10 * $spacer,
);

@mixin make-space($dir-name, $dir, $spacer, $spacing-type) {
Expand Down
136 changes: 127 additions & 9 deletions packages/core/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,134 @@
</head>
<body>
<!-- keep this sandbox empty before pushing changes -->
<go-radio-group id="radio-group">
<go-radio value="a">Option 1</go-radio>
<go-radio value="b">Option 2</go-radio>
<go-radio value="c">Option 3</go-radio>
</go-radio-group>
<!-- material icons -->
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
<go-main-nav id="main-nav"></go-main-nav>
<go-nav-list block id="nav-list"></go-nav-list>
<script>
const radioGroup = document.querySelector('#radio-group');
radioGroup.addEventListener('change', (e) => {
console.log(e.detail.value);
});
const mainNav = document.getElementById('main-nav');
const navList = document.getElementById('nav-list');

const navItems = [
{
label: 'Home',
url: '#',
icon: 'home',
isCurrent: true,
},
{
label: 'Components',
url: '#',
icon: 'view_module',
description: 'lorem ipsum dolor sit amet consectetur adipisicing elit',
children: [
{
label: 'Sub menu 1',
url: '#submenu',
icon: 'text_fields',
},
{
label: 'Colors',
url: '#',
icon: 'color_lens',
},
{
label: 'Icons',
url: '#',
icon: 'image',
},
{
label: 'Buttons',
url: '#',
icon: 'touch_app',
},
],
},
{
label: 'Styleguide',
url: '#',
icon: 'style',
children: [
{
label: 'Typography',
url: '#',
icon: 'text_fields',
children: [
{
label: 'Headings',
url: '#',
icon: 'text_fields',
children: [
{
label: 'Heading 1',
url: '#',
},
{
label: 'Heading 2',
url: '#',
},
],
},
{
label: 'Paragraphs',
url: '#',
icon: 'text_fields',
},
{
label: 'Lists',
url: '#',
icon: 'text_fields',
},
{
label: 'Code',
url: '#',
icon: 'text_fields',
},
{
label: 'Tables',
url: '#',
icon: 'text_fields',
},
],
},
{
label: 'Colors',
url: '#',
icon: 'color_lens',
children: [
{
label: 'Primary',
url: '#',
icon: 'color_lens',
},
],
},
{
label: 'Icons',
url: '#',
icon: 'image',
},
{
label: 'Buttons',
url: '#',
icon: 'touch_app',
},
{
label: 'Forms',
url: '#',
icon: 'text_fields',
},
],
},
{
label: 'About',
url: '#',
icon: 'info',
},
];

mainNav.items = navItems;
navList.items = navItems;
</script>
</body>
</html>
27 changes: 18 additions & 9 deletions packages/core/src/patterns/go-heading-row/go-heading-row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,37 @@ export class GoHeadingRow {

hasHeadingSlot: boolean;

hasActionSlot: boolean;

componentWillLoad() {
this.hasHeadingSlot = !!this.el.querySelector('slot[name="heading"]');
this.hasActionSlot = !!this.el.querySelector('slot[name="action"]');
}

render() {
const { heading, moreLinkHref, moreLinkText, hasHeadingSlot, headingTag: HeadingTag } = this;
const { heading, moreLinkHref, moreLinkText, hasHeadingSlot, hasActionSlot, headingTag: HeadingTag } = this;
const shouldRenderHeading = heading || hasHeadingSlot;
const shouldRenderMoreLink = moreLinkHref && moreLinkText;
const shouldRenderMoreLink = (moreLinkHref && moreLinkText) || hasActionSlot;
return (
<Host>
{shouldRenderHeading || shouldRenderMoreLink ? (
<div class="heading-row">
{shouldRenderHeading ? (
<slot>
<slot name="heading">
<HeadingTag>{heading}</HeadingTag>
</slot>
) : (
<span></span>
)}
{shouldRenderMoreLink ? (
<go-nav-link
item={{
url: moreLinkHref,
label: moreLinkText,
}}
showArrow={true}></go-nav-link>
<slot name="action">
<go-nav-link
item={{
url: moreLinkHref,
label: moreLinkText,
}}
showArrow={true}></go-nav-link>
</slot>
) : null}
</div>
) : null}
Expand Down
5 changes: 1 addition & 4 deletions packages/vue/src/components/GoRadio.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@

<script lang="ts">
import { defineComponent } from 'vue';
import { GoRadio, defineCustomElement } from '@go-ui/core/dist/components/go-radio';
import type { GoRadio } from '@go-ui/core/dist/components/go-radio';
export default defineComponent({
name: 'GoRadio',
beforeMount() {
// defineCustomElement();
},
props: {
modelValue: {
type: [String, Object, Boolean],
Expand Down