Skip to content

Commit 9a86d5d

Browse files
committed
Merge branch 'master' into 4.8.x
2 parents ebde8d6 + 0c1ee10 commit 9a86d5d

21 files changed

+288
-171
lines changed

.github/CODE_OF_CONDUCT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Examples of unacceptable behaviour by participants include:
2626

2727
Project maintainers are responsible for clarifying the standards of acceptable behaviour and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behaviour.
2828

29-
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
29+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviours that they deem inappropriate, threatening, offensive, or harmful.
3030

3131
## Scope
3232

.github/CONTRIBUTING.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Contributing to Textpattern
2+
3+
If you want to help with the development of Textpattern, there are plenty of ways to get involved. Please take a moment to review this document in order to make the contribution process easy and effective for everyone.
4+
5+
## Who can contribute?
6+
7+
Anyone can contribute. You do not have to ask for permission.
8+
9+
## How can I contribute?
10+
11+
### Help with translations
12+
13+
To make corrections to existing translations, or to add new ones, [please follow these instructions](https://github.com/textpattern/textpacks/blob/master/README.md).
14+
15+
### Write documentation
16+
17+
Want to get involved in the Textpattern CMS user documentation project? Spot any errors? Want to add more documents or fix others? Then [please follow these instructions](https://github.com/textpattern/textpattern.github.io/blob/master/README.md).
18+
19+
### Contribute code
20+
21+
Core developers and project maintainers accept Pull Requests. The [main code repository](https://github.com/textpattern/textpattern) uses [Git](https://www.sitepoint.com/git-for-beginners/) for its version control and is split into at least three branches:
22+
23+
* `master`: for stable releases only. Core devs only ever merge production-ready code here at release time.
24+
* `maint-x.y.z`: for patching the most recent stable release.
25+
* `dev`: for development of the next major version.
26+
27+
There may be other branches with partially-completed features awaiting merge, but the above are always present. Once you have cloned/forked the repository, ensure you have checked out the correct branch before submitting a Pull Request.
28+
29+
The general steps for Pull Requests:
30+
31+
* Switch to the correct branch (`git checkout branch-name`), where `branch-name` is either `maint-x.y.z` to patch or bug fix the existing stable product, or `dev` for a feature/fix to go in the next major version.
32+
* Pick an [existing issue](https://github.com/textpattern/textpattern/issues) you intend to work on, or [create a new issue](https://github.com/textpattern/textpattern/issues/new) if no existing issue matches your topic.
33+
* Make a new branch for your work.
34+
* Hack along.
35+
* Push your changes to your fork on GitHub.
36+
* Visit your repository's page on GitHub and click the 'Pull Request' button.
37+
* Label the pull request with a clear title and description.
38+
39+
### Coding standard
40+
41+
The project follows the [PSR-0](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md) and [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide-meta.md) standards with PHP 5.3 style namespacing. You can use [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) to make sure your additions follow them, too:
42+
43+
~~~ ShellSession
44+
$ ./vendor/bin/phpcs --standard=phpcs.xml *.php textpattern
45+
~~~
46+
47+
### Versioning
48+
49+
The project follows [Semantic Versioning](https://semver.org/) and the `major.minor.patch` format.
50+
51+
## Increasing the likelihood of code being accepted
52+
53+
We accept most, but not all code that is submitted for inclusion in the Textpattern core. Sometimes we'll accept part of a patch or pull request, or include a modified or abridged version.
54+
55+
Textpattern is open source, so you don't need our permission to make your own modifications or extensions. However, if you want to maximize the chances it will be accepted and included in the official distribution, here is a quick guide to the Textpattern development philosophy.
56+
57+
### Do the simplest thing that could possibly work
58+
59+
Is there a shorter or easier way to achieve the same result? Then do it that way. Less code often means fewer bugs and is easier to maintain.
60+
61+
Don't reinvent the wheel. Is there already a function in PHP or Textpattern that makes your job easier? Use it.
62+
63+
### Minimize assumptions
64+
65+
Don't try to solve a problem unless you've tested it. This is particularly important for performance enhancements: measure the speed before and after - is the improvement really significant? If not, the simplest solution might be to leave it alone.
66+
67+
Similarly, don't write a bunch of functions or tag attributes on the assumption that they might be useful in the future. Unless you have a use case, leave it out.
68+
69+
### Make it testable
70+
71+
This is the most important part. It makes the development team's job easier if the code is deemed supportable and maintainable - after all, we're the ones who will receive the bug reports and cries for help. The more you can do to help test your code, the better: examples of input and expected output, a test plan, notes on what you have and haven't tested.
72+
73+
If you have a big patch, consider splitting it into smaller, related chunks. Git branches are ideal for this as you can commit to each branch and hop between them, then submit each as a separate pull request. Also, please ensure your patch has the latest branch from our repo merged into it immediately prior to submission. If you have written the patch against the `dev` branch, for example, do `git merge dev` when on your branch to pull forward any recent changes to dev from other developers, then prepare your pull request. This step makes it easier for us to pull the patch down and test it in our development environments.
74+
75+
Scripted unit tests are becoming increasingly important in the Textpattern release process. You can make your code more testable by using a [functional design](https://en.wikipedia.org/wiki/Functional_design) with minimal coupling. A function that can be run in isolation, and returns a value based on its arguments, is easy to test. A function that prints output based on global variables, database records and configuration values is much harder to test (conveniently, Textpattern tag handler functions are usually easy to test).
76+
77+
Sure, we break our own rules sometimes. But, as a rule, we err on the side of simplicity.
78+
79+
## License
80+
81+
[GNU General Public License, version 2](https://github.com/textpattern/textpattern/blob/master/LICENSE.txt) (also known as GPLv2). By contributing to the project, you agree to license your contributions under the GPLv2 license.
82+
83+
## Code of conduct
84+
85+
Please see [Contributor covenant code of conduct](https://github.com/textpattern/textpattern/blob/dev/.github/CODE_OF_CONDUCT.md).

.github/FUNDING.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github: textpattern
2+
custom: https://textpattern.com/about/302/patrons

.stylelintrc.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ rules:
1212
# Specify percentage or number notation for alpha-values.
1313
alpha-value-notation: number
1414

15-
# Specify a blacklist of disallowed at-rules.
16-
at-rule-blacklist:
15+
# Specify a list of disallowed at-rules.
16+
at-rule-disallowed-list:
1717
- debug
1818

1919
# Require or disallow an empty line before at-rules.
@@ -42,8 +42,22 @@ rules:
4242
- true
4343
-
4444
ignoreAtRules:
45+
- at-root
46+
- each
47+
- else
48+
- debug
49+
- error
50+
- extend
51+
- for
52+
- forward
53+
- function
54+
- if
4555
- include
4656
- mixin
57+
- return
58+
- use
59+
- warn
60+
- while
4761

4862
# Disallow vendor prefixes for at-rules.
4963
at-rule-no-vendor-prefix: true

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22

33
[![Build Status](https://travis-ci.org/textpattern/textpattern-default-theme.svg?branch=master)](https://travis-ci.org/textpattern/textpattern-default-theme)
44
[![Known Vulnerabilities](https://snyk.io/test/github/textpattern/textpattern-default-theme/badge.svg?targetFile=package.json)](https://snyk.io/test/github/textpattern/textpattern-default-theme?targetFile=package.json)
5-
[![devDependencies Status](https://david-dm.org/textpattern/textpattern-default-theme/dev-status.svg)](https://david-dm.org/textpattern/textpattern-default-theme?type=dev)
6-
[![optionalDependencies Status](https://david-dm.org/textpattern/textpattern-default-theme/optional-status.svg)](https://david-dm.org/textpattern/textpattern-default-theme?type=optional)
75

86
[Demo](https://default-theme.textpattern.com/)
97

10-
This project is the source for the default theme that ships as standard with [Textpattern CMS](https://textpattern.com/) as of v4.7.0 onwards. It is intended as a starting point for new users learning the Textpattern CMS for the first time or existing users that want to adapt their current code for modern standards, and is not intended as a finished production theme (though you could use it as such if you want to).
8+
This project is the source for the default theme that ships as standard with [Textpattern CMS](https://textpattern.com/). It is intended as a starting point for new users learning the Textpattern CMS for the first time or existing users that want to adapt their current code for modern standards, and is not intended as a finished production theme (though you could use it as such if you want to).
119

1210
## Features
1311

@@ -22,8 +20,9 @@ This project is the source for the default theme that ships as standard with [Te
2220

2321
## Supported web browsers
2422

25-
* Internet Explorer 11.
2623
* Chrome, Edge, Firefox, Safari and Opera the last two recent stable releases.
24+
* Internet Explorer 11.
25+
* Firefox ESR latest major point release.
2726

2827
## Requirements
2928

package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "textpattern-default-theme",
33
"title": "Default theme",
44
"txp-type": "textpattern-theme",
5-
"version": "4.8.2",
5+
"version": "4.8.3",
66
"description": "The default theme that ships as standard with Textpattern CMS.",
77
"author": "Team Textpattern",
88
"homepage": "https://github.com/textpattern/textpattern-default-theme",
@@ -25,22 +25,22 @@
2525
"url": "https://github.com/textpattern/textpattern-default-theme/issues"
2626
},
2727
"devDependencies": {
28-
"autoprefixer": "9.8.0",
28+
"autoprefixer": "9.8.6",
2929
"clean-webpack-plugin": "3.0.0",
30-
"copy-webpack-plugin": "6.0.1",
30+
"copy-webpack-plugin": "6.1.0",
3131
"cross-env": "7.0.2",
32-
"css-loader": "3.5.3",
33-
"file-loader": "6.0.0",
34-
"mini-css-extract-plugin": "0.9.0",
32+
"css-loader": "4.3.0",
33+
"file-loader": "6.1.0",
34+
"mini-css-extract-plugin": "0.11.1",
3535
"postcss-loader": "3.0.0",
36-
"sass": "1.26.5",
37-
"sass-loader": "8.0.2",
38-
"stylelint": "13.5.0",
39-
"stylelint-order": "4.0.0",
40-
"stylelint-scss": "3.17.2",
41-
"stylelint-webpack-plugin": "2.0.0",
42-
"webpack": "4.43.0",
43-
"webpack-cli": "3.3.11"
36+
"sass": "1.26.10",
37+
"sass-loader": "10.0.2",
38+
"stylelint": "13.7.0",
39+
"stylelint-order": "4.1.0",
40+
"stylelint-scss": "3.18.0",
41+
"stylelint-webpack-plugin": "2.1.0",
42+
"webpack": "4.44.1",
43+
"webpack-cli": "3.3.12"
4444
},
4545
"optionalDependencies": {
4646
"fibers": "5.0.0"

src/scss/default.scss

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
// import global variables
2-
@import "setup/settings";
2+
@use "sass:meta";
3+
@use "setup/settings";
34

45
// import any additional mixins
5-
@import "setup/helpers";
6+
@use "setup/helpers";
67

78
// import colourscheme
8-
@import "setup/colours";
9+
@use "setup/colours";
910

1011

1112

1213
/* ==========================================================================
1314
Styling and layout for all media
1415
========================================================================== */
1516

16-
@import "modules/base";
17+
@use "modules/base";
1718

1819

1920

@@ -22,28 +23,28 @@
2223
========================================================================== */
2324

2425
@media screen {
25-
@import "modules/layout";
26-
@import "modules/navigation";
27-
@import "modules/links";
28-
@import "modules/typography";
29-
@import "modules/internationalization";
30-
@import "modules/embedded-content";
31-
@import "modules/tables";
32-
@import "modules/lists";
33-
@import "modules/forms";
34-
@import "modules/buttons";
35-
@import "modules/comments";
26+
@include meta.load-css("modules/layout");
27+
@include meta.load-css("modules/navigation");
28+
@include meta.load-css("modules/links");
29+
@include meta.load-css("modules/typography");
30+
@include meta.load-css("modules/internationalization");
31+
@include meta.load-css("modules/embedded-content");
32+
@include meta.load-css("modules/tables");
33+
@include meta.load-css("modules/lists");
34+
@include meta.load-css("modules/forms");
35+
@include meta.load-css("modules/buttons");
36+
@include meta.load-css("modules/comments");
3637
}
3738

38-
@import "modules/responsive";
39+
@include meta.load-css("modules/responsive");
3940

4041

4142

4243
/* ==========================================================================
4344
Additional accessibility for screen media
4445
========================================================================== */
4546

46-
@import "modules/accessibility";
47+
@include meta.load-css("modules/accessibility");
4748

4849

4950

@@ -52,5 +53,5 @@
5253
========================================================================== */
5354

5455
@media print {
55-
@import "modules/print";
56+
@include meta.load-css("modules/print");
5657
}

src/scss/modules/_base.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ header,
5252
footer,
5353
nav ul,
5454
nav ol,
55-
.container,
56-
.paginator {
55+
.container {
5756
&::after {
5857
content: "";
5958
display: table;

src/scss/modules/_buttons.scss

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
@use "sass:color";
2+
@use "../setup/colours";
3+
@use "../setup/helpers";
4+
15
/* Buttons
26
========================================================================== */
37

@@ -35,18 +39,18 @@ button,
3539
[type="button"],
3640
[type="reset"],
3741
[type="submit"] {
38-
@include gradient-linear($color-button-gradient-from, $color-button-gradient-to);
42+
@include helpers.gradient-linear(colours.$color-button-gradient-from, colours.$color-button-gradient-to);
3943

4044
display: inline-block;
4145
position: relative;
4246
width: auto;
4347
height: 2em; // 32px / 16px
4448
padding: 0.25em 1em; // 4px / 16px
45-
border: 1px solid $color-button-border;
49+
border: 1px solid colours.$color-button-border;
4650
border-radius: 1em;
4751
background-clip: padding-box;
48-
box-shadow: 0 2px 0 $color-button-shadow;
49-
color: $color-text-button;
52+
box-shadow: 0 2px 0 colours.$color-button-shadow;
53+
color: colours.$color-text-button;
5054
font-weight: normal;
5155
text-align: center;
5256
/* 1 */
@@ -55,23 +59,23 @@ button,
5559
cursor: pointer;
5660

5761
&:hover {
58-
@include gradient-linear(lighten($color-button-gradient-from, 4%), lighten($color-button-gradient-to, 4%));
62+
@include helpers.gradient-linear(color.adjust(colours.$color-button-gradient-from, $lightness: 4%), color.adjust(colours.$color-button-gradient-to, $lightness: 4%));
5963

60-
border-color: darken($color-button-border, 13%);
61-
color: $color-text-button-hover;
64+
border-color: color.adjust(colours.$color-button-border, $lightness: -13%);
65+
color: colours.$color-text-button-hover;
6266
text-decoration: none;
6367
}
6468

6569
&:active {
6670
top: 2px;
67-
border-color: darken($color-button-border, 13%);
71+
border-color: color.adjust(colours.$color-button-border, $lightness: -13%);
6872
box-shadow: none;
69-
color: $color-text-button-active;
73+
color: colours.$color-text-button-active;
7074
text-decoration: none;
7175
}
7276

7377
&:focus {
74-
border-color: $color-link-focus;
78+
border-color: colours.$color-link-focus;
7579
outline: 1px solid transparent; // Allows for repainting in high contrast modes.
7680
}
7781
}

0 commit comments

Comments
 (0)