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 --farmos-map-accent-color CSS property #186

Merged
merged 1 commit into from
Oct 24, 2022
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: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Add `--farmos-map-accent-color` CSS property. #186

### Fixed

- Fix color scheme compliance of remaining icons. #181

### Changed

- Improve interaction and control docs. #185
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,16 @@ all the behaviors from `farmOS.map.behaviors` have finished being attached to th

## Advanced Integration

### Accent color

The farmOS-map accent color can be changed with the `--farmos-map-accent-color` custom CSS property.

```css
#farm-map {
--farmos-map-accent-color: #336633;
}
```

### Working with farmOS-map in an NPM/Webpack Project

Some integration scenarios require farmOS-map to be modeled as a dependency - i.e. so static analysis can
Expand Down
8 changes: 6 additions & 2 deletions src/styles.css
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
/* Control color. */
:root {
--farmos-map-accent-color: green;
}

.ol-control {
background-color: rgba(255, 255, 255, 0.25);
}

.ol-control svg {
fill: green;
fill: var(--farmos-map-accent-color);
}

.ol-control button {
color: green;
color: var(--farmos-map-accent-color);
background-color: rgba(255, 255, 255, 0.8);
}

Expand Down