CSS syntax highlighting for the Thonny editor
Project description
Thonny CSS Highlighter
A small Thonny front-end plug-in that adds syntax highlighting for .css files.
It is designed primarily for viewing and editing CSS in teaching projects where
HTML, CSS, and Python files are kept together.
Highlighted constructs
- block comments and quoted strings
- selectors, classes, IDs, pseudo-classes, and pseudo-elements
- property names and custom properties
- at-rules and
!important - numbers, dimensions, percentages, and hexadecimal colors
- CSS functions such as
var(),calc(),clamp(), andrgb() - common CSS value keywords
- nested rules and common rule-list at-rules such as
@media,@supports,@container,@layer, and@keyframes
The plug-in reuses Thonny's standard syntax-theme tags. Consequently, CSS highlighting follows the syntax theme selected under Tools → Options → Theme & Font.
Install the wheel
- Open Thonny.
- Select Tools → Manage plug-ins.
- Choose Install from local file.
- Select
thonny_css_highlighter-0.1.0-py3-none-any.whl. - Restart Thonny.
- Open a
.cssfile.
The source directory can also be installed during development:
python -m pip install -e .
Run tests with:
python -m pytest
Compatibility
The package requires Python 3.10 or newer and targets Thonny 4.1 through 5.x. It
uses Thonny's current plug-in convention: a package below the thonnycontrib
namespace with a parameterless load_plugin() function.
Implementation note
Thonny's built-in colorer is Python-specific and clears the standard theme tags
for non-Python files. This plug-in bypasses that colorer only for editors whose
file type is css, then applies its own tolerant lexer. Other editor types keep
Thonny's normal behavior.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file thonny_css_highlighter-0.1.0.tar.gz.
File metadata
- Download URL: thonny_css_highlighter-0.1.0.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5deb21e6fe6f5e4226ebca6fa12a2e196827dc76e26104415c1b83028da8722a
|
|
| MD5 |
03367c197c00954f7796962a65a829f6
|
|
| BLAKE2b-256 |
0c14a301f8e199bfe1e5300c3528874ddad7ec2d064bc9a4b2c45cf36f8f99c8
|
Provenance
The following attestation bundles were made for thonny_css_highlighter-0.1.0.tar.gz:
Publisher:
ci-publish.yml on acbart/thonny-css-highlighter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
thonny_css_highlighter-0.1.0.tar.gz -
Subject digest:
5deb21e6fe6f5e4226ebca6fa12a2e196827dc76e26104415c1b83028da8722a - Sigstore transparency entry: 2256657970
- Sigstore integration time:
-
Permalink:
acbart/thonny-css-highlighter@2decbfdd75652b1c8a76134a9636ec60d8647b2b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/acbart
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci-publish.yml@2decbfdd75652b1c8a76134a9636ec60d8647b2b -
Trigger Event:
release
-
Statement type:
File details
Details for the file thonny_css_highlighter-0.1.0-py3-none-any.whl.
File metadata
- Download URL: thonny_css_highlighter-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2401686d43e0042f53a78e93002cce08acd1ae39a019718203974b88200095bc
|
|
| MD5 |
7930c1a8649249389ce8cd20cb6204dd
|
|
| BLAKE2b-256 |
2c27432526f591386b92a6f8e969430e5c849be926eb376e86710e81582ad9af
|
Provenance
The following attestation bundles were made for thonny_css_highlighter-0.1.0-py3-none-any.whl:
Publisher:
ci-publish.yml on acbart/thonny-css-highlighter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
thonny_css_highlighter-0.1.0-py3-none-any.whl -
Subject digest:
2401686d43e0042f53a78e93002cce08acd1ae39a019718203974b88200095bc - Sigstore transparency entry: 2256657971
- Sigstore integration time:
-
Permalink:
acbart/thonny-css-highlighter@2decbfdd75652b1c8a76134a9636ec60d8647b2b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/acbart
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci-publish.yml@2decbfdd75652b1c8a76134a9636ec60d8647b2b -
Trigger Event:
release
-
Statement type: