Skip to content

Commit

Permalink
Small button styles (#116)
Browse files Browse the repository at this point in the history
* Don't make all small buttons bold

* Fix list marker colour on accented blocks

* Update CHANGELOG.md
  • Loading branch information
ahosgood authored Apr 8, 2024
1 parent 90bf863 commit 5ab77bc
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 23 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/publish-chromatic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish to Chromatic

on:
push:
branches:
- main
paths:
- '.storybook/**'
- 'src/**'
tags-ignore:
- '**'

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: chromatic
cancel-in-progress: true

jobs:
chromatic:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Install dependencies
run: npm ci
- name: Build Storybook
run: npm run build:storybook
- uses: chromaui/action@v1
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
storybookBuildDir: storybook
exitZeroOnChanges: true
autoAcceptChanges: true
22 changes: 1 addition & 21 deletions .github/workflows/publish-storybook.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Storybook
name: Publish to GitHub pages

on:
push:
Expand Down Expand Up @@ -50,23 +50,3 @@ jobs:
path: storybook
- id: deployment
uses: actions/deploy-pages@v4

chromatic:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Install dependencies
run: npm ci
- name: Build Storybook
run: npm run build:storybook
- uses: chromaui/action@v1
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
storybookBuildDir: storybook
exitZeroOnChanges: true
autoAcceptChanges: true
4 changes: 4 additions & 0 deletions .storybook/storybook.scss
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@
p:not(:first-child) {
margin-top: 0.25rem;
}

.tna-ul {
margin-top: 0.25rem;
}
}

.tna-form__group {
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased](https://github.com/nationalarchives/tna-frontend/compare/v0.1.52...HEAD)

### Added

- Footer component can now contain an optional theme selector which requires the component to have JavaScript initialised
- The Cookie library is now a singleton

### Changed
### Deprecated
### Removed
Expand Down
2 changes: 1 addition & 1 deletion src/nationalarchives/components/button/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ $button-border-width: 4px !default;

&--small#{&}--plain,
&-group--small &--plain {
@include typography.main-font-weight-bold;
// @include typography.main-font-weight-bold;
}

&--accent {
Expand Down
4 changes: 4 additions & 0 deletions src/nationalarchives/components/footer/footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
.tna-button-group {
justify-content: flex-end;
}

.tna-button {
@include typography.main-font-weight-bold;
}
}

&__theme-selector-button {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ const Template = ({ theme }) => {
<h1 class="tna-heading-s">Heading</h1>
<p>Text / <span class="dark-text">Dark</span> / <span class="light-text">Light</span> / <i class="fa-solid fa-heart" aria-hidden="true"></i> <i class="fa-solid fa-heart light-icon" aria-hidden="true"></i></p>
<p><a href="#">Link</a> / <a href="#" class="tna-colour-contrast-demo__link--visited">Link (visited)</a></p>
<ul class="tna-chip-list">
<ul class="tna-ul">
<li>Alpha</li>
</ul>
<ul class="tna-chip-list tna-!--margin-top-xs">
<li class="tna-chip-list__item">
<span class="tna-chip">Chip</span>
</li>
Expand All @@ -87,6 +90,7 @@ const Template = ({ theme }) => {
},
],
disableAutoFocus: true,
classes: "tna-!--margin-top-s",
},
})}
${TextInput({
Expand Down
4 changes: 4 additions & 0 deletions src/nationalarchives/utilities/_lists.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
li::marker {
@include colour.colour-font("accent-background");
font-weight: 700;

.tna-background-accent & {
@include colour.colour-font("font-dark");
}
}

&--plain {
Expand Down

0 comments on commit 5ab77bc

Please sign in to comment.