Skip to content

Commit

Permalink
feat: update custom style
Browse files Browse the repository at this point in the history
  • Loading branch information
zgq354 committed Dec 24, 2023
1 parent 3acf0fa commit 9e814e1
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 44 deletions.
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,16 @@ The customizations of **Flarum 0x** consists of these parts:
1. Initialized [Flarum Skeleton](https://github.com/flarum/flarum) with our custom `composer.json` / `composer.lock` config (contains the extensions we are using).
2. Patches for the extensions in `vendor/` to make some small changes without publishing new Composer Packages (see [patches/README.md](patches/README.md)).
3. Custom [flarum extenders](https://docs.flarum.org/extend/start#extenders) in `extend.php`.
4. *(Will be added if needed)* Custom third party extension integrated into this repo as submodules.
4. Custom third party extension integrated into this repo as submodules.

The features we have customised include:
1. Support global assets CDN config.
2. Save avatars to S3-compatible Storage instead of local disk (thanks to [askvortsov1/flarum-azure-poc](https://github.com/askvortsov1/flarum-azure-poc)).
3. Add support for [blomstra/flarum-redis](https://github.com/blomstra/flarum-redis) extension (for Queue / Cache / Session), enable the Queue Worker to consume the [Background Tasks](https://docs.flarum.org/internal/package-manager#background-tasks) asynchronously.
4. Add support for custom head HTML like add some `<script>` / `<link>` / `<meta>` tags in `config.php`.
5. Customised Chinese Pinyin slug generation logic.
6. Replace some hard-coded JsDelivr resource URLs with ByteDance's cdn (for mainland China users).
7. All the extensions required at `composer.json`
8. ...
5. Replace some hard-coded JsDelivr resource URLs with ByteDance's cdn (for mainland China users).
6. All the extensions required at `composer.json`
7. ...

## Local Development Env Setup
We are using [Development Containers](https://containers.dev/) with our LNMP config to save the time required to configure the environment.
Expand All @@ -41,7 +40,7 @@ Basically running a **Flarum 0x** website requires two Docker container instance
1. **Flarum 0x**, latest pre-built image: `ghcr.io/0xffff-one/flarum-0x:latest`.
2. **A MySQL-compatible DBMS**, MySQL, MariaDB or other, use MySQL with [ngram](https://dev.mysql.com/doc/refman/5.7/en/fulltext-search-ngram.html) support for CJK full-text search.

We are currently using [fly.io](https://fly.io/) to host our website, you can also deploy them via [Docker Compose](./docker-compose.yml).
You can deploy them via [Docker Compose](./docker-compose.yml).

## Contribution
Any contributions are welcome. Please feel free to:
Expand All @@ -58,7 +57,7 @@ Thank you for willing to contribute to this project!
- [x] new Dev Envionment setup config
- [x] build process for Front-end Patching
- [x] Update latest README.md about Dev Env setup and Production deployment
- [ ] Optimize the production Docker image config
- [x] Optimize the production Docker image config

## Contributors
This project exists thanks to all the people who contribute.
Expand Down
97 changes: 60 additions & 37 deletions resources/less/custom.less
Original file line number Diff line number Diff line change
@@ -1,58 +1,56 @@

.Hero-close {
display: none;
}

.katex .katex-mathml {
position: absolute;
clip: rect(1px,1px,1px,1px);
padding: 0;
border: 0;
height: 1px;
width: 1px;
overflow: hidden;
position: absolute;
clip: rect(1px, 1px, 1px, 1px);
padding: 0;
border: 0;
height: 1px;
width: 1px;
overflow: hidden;
}


.Post-body h1 {
font-size: 175%;
font-size: 175%;
}

.Post-body h2 {
font-size: 150%;
font-size: 150%;
}

.Post-body h3 {
font-size: 125%;
font-size: 125%;
}

// for image size optimize
.Post-body img[width][height]:not([width=""]):not([height=""]) {
height: auto;
.Post-body img[width][height]:not([width='']):not([height='']) {
height: auto;
}

.Post-body img {
object-fit: contain;
object-fit: contain;
}

@media (max-width: 767px) {
.App {
padding-bottom: 0px;
}
.App {
padding-bottom: 0px;
}

.App-content {
padding-bottom: 30px;
}
.App-content {
padding-bottom: 30px;
}

.PostStream-item {
overflow: hidden;
}
.PostStream-item {
overflow: hidden;
}
}

.DiscussionListItem-info .item-excerpt {
max-height: 3em;
text-overflow: ellipsis;
overflow: hidden;
max-height: 3em;
text-overflow: ellipsis;
overflow: hidden;
}

/* fix iPhone X problem */
Expand All @@ -64,29 +62,28 @@
#header,
#content,
.Post .PostUser-avatar {
-webkit-user-select: none;
user-select: none;
-webkit-user-select: none;
user-select: none;
}

.DiscussionHero-items,
.CommentPost .Post-header,
.CommentPost .Post-body {
-webkit-user-select: text;
user-select: text;
-webkit-user-select: text;
user-select: text;
}

.Pages-container {
white-space: inherit !important;
-webkit-user-select: text;
user-select: text;
white-space: inherit !important;
-webkit-user-select: text;
user-select: text;
}

.Post-body h3 {
font-size: 125%;
margin-top: 1.5em;
font-size: 125%;
margin-top: 1.5em;
}


.DiffDropdown {
left: -10px;
top: 1px;
Expand All @@ -99,3 +96,29 @@
a {
outline: none;
}

// Fix to prevent horizontal scrolling bug on iOS
@media @phone {
html {
overflow-x: hidden;
}
}

// cf turnstile
.Blomstra-Turnstile {
height: 65px;
margin-bottom: 12px;
}

.Blomstra-Turnstile > iframe {
width: 100% !important;
}

.Badge--social {
margin: -3px 3px -3px 0;
}

.social-settings > .fa-cog.fa-cog {
border-left: none;
margin-left: 3px;
}

0 comments on commit 9e814e1

Please sign in to comment.