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

Add utility classes #6838

Merged
merged 2 commits into from
Jan 23, 2024
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
8 changes: 5 additions & 3 deletions config/storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@

import React from 'react'
import { Provider } from 'react-redux'
import { ConnectedRouter } from 'connected-react-router'
import { IntlProvider } from 'react-intl'
import { createMemoryHistory } from 'history'
import { MemoryRouter } from 'react-router-dom'

import messages from '@ttn-lw/locales/en.json'
import backendMessages from '@ttn-lw/locales/.backend/en.json'

import '../../pkg/webui/styles/main.styl'
import '../../pkg/webui/styles/utilities/general.styl'
import '../../pkg/webui/styles/utilities/spacing.styl'
import 'focus-visible/dist/focus-visible'
import createStore from './store'
import Center from './center'
Expand All @@ -35,9 +37,9 @@ export const decorators = [
Story => (
<Provider store={store}>
<IntlProvider key="key" messages={{ ...messages, ...backendMessages }} locale="en-US">
<ConnectedRouter history={history}>
<MemoryRouter>
<Center>{Story()}</Center>
</ConnectedRouter>
</MemoryRouter>
</IntlProvider>
</Provider>
),
Expand Down
2 changes: 2 additions & 0 deletions pkg/webui/lib/components/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ import {
import Message from './message'

import '@ttn-lw/styles/main.styl'
import '@ttn-lw/styles/utilities/general.styl'
import '@ttn-lw/styles/utilities/spacing.styl'

const m = defineMessages({
initializing: 'Initializing…',
Expand Down
48 changes: 2 additions & 46 deletions pkg/webui/styles/main.styl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ code
background-color: $c-text-backdrop
padding: 0.1rem $cs.xxs
color: $tc-black

summary
display: revert
cursor: pointer
Expand Down Expand Up @@ -107,51 +107,7 @@ summary

.tc-deep-gray
color: $tc-deep-gray

.p-0
padding: 0 !important

.pt-0
margin-top: 0 !important

.pb-0
margin-bottom: 0 !important

.m-0
margin: 0 !important

.mt-0
margin-top: 0 !important

.mb-0
margin-bottom: 0 !important

for $size in 'xxs' 'xs' 's' 'l' 'm' 'l' 'xl' 'xxl'
.mt-cs-{$size}
margin-top: $cs[$size] !important

.mb-cs-{$size}
margin-bottom: $cs[$size] !important

.ml-cs-{$size}
margin-left: $cs[$size] !important

.mr-cs-{$size}
margin-right: $cs[$size] !important

for $size in 'xxs' 'xs' 's' 'l' 'm' 'l' 'xl' 'xxl'
.mt-ls-{$size}
margin-top: $ls[$size] !important

.mb-ls-{$size}
margin-bottom: $ls[$size] !important

.ml-ls-{$size}
margin-left: $ls[$size] !important

.mr-ls-{$size}
margin-right: $ls[$size] !important


.panel-title
padding-bottom: $cs.xs
border-bottom: 1px solid $c-divider
Loading
Loading